The suspect, Daniel Patrick Rodriguez Jr., is charged with murder and child endangerment due to the victim's 8-year-old child witnessing the incident.
The stabbing happened September 10 shortly after Robert Paul Byrd, 35, picked up his son from Commodore Sloat Elementary School.
RELATED: Bail denied for suspect who fatally stabbed SF father in front of his son near school
The San Francisco Chronicle reports that prosecutors say Rodriguez brushed shoulders in a crosswalk with Byrd which escalated into the stabbing.
The men were strangers.
RELATED: SFPD arrests suspect in fatal stabbing of father in front of child near elementary school
Byrd's supporters say he and his son were holding hands moments before the stabbing.
Rodriguez's lawyer previously said he wants him moved to a hospital for cancer treatment.
Rodriguez was denied bail and remains in custody. His next court date is October 1.