A man was set on fire in San Francisco’s Mission District Tuesday morning, and a woman may have saved his life, according to the San Francisco Police Department.

At about 10 a.m., officials say a female saw smoke walking down the alley of 24th and Osage Street in the city's Mission District when she noticed a man on fire. The female witness ran to a nearby café to get a bucket of water and asked the café to call 911 then ran back to pour water on the victim, police said.

"It was absolutely heroic. Absolutely," Lt. Rachel Murphy said. "It is unknown if it was self-inflicted, accidental or if there were suspects involved. Right now, it is unknown the victim’s age or race, but it is a male."

The victim was transported to San Francisco General and remained in critical condition until Wednesday morning, police said.

NBC Bay Area's Anoushah Rasta contributed to this report.