Arthur Lee Jones, of Fairfield was arrested on Friday.
Surveillance video shows a man smashing the victim in the head with some kind of pipe or bat.
The footage clearly shows the suspect walking on Larkin Street, and when he reaches a homeless man sitting against a wall, he attacks the man.
"Pulls out a blunt metal object and, almost like a baseball swing, swings it across the left side of the victims head, knocking him unconscious," said Officer Carlos Manfredi with San Francisco police.
The incident happened shortly before 9:30 p.m. Wednesday.
Manfredi says the victim lost a lot of blood and needed 50 stitches. He's taking this case personally because he knows the homeless man.
"He's a very nice man. He doesn't try to harm anyone. He always says hi to everyone who says hi to him," Manfredi said.
The owner of the Gangway Bar also knows the victim. He says his name is Robert.
"The Robert victim, he's a regular guy," said Jung Lee. "He sit here morning, day, night. You know, every day, maybe a decade, 10 years."
It seems a lot of people know Robert.
"He was a pain in the butt for the most part, but he was OK. He never bothered anybody," said Fredrick McCallister, a San Francisco resident.
McCallister brought flowers and candles to the scene.
"These are like, little flowers, maybe they'll help him get better," McCallister said.
Jones could be charged with attempted murder.