The stabbing happened at about 3:45 a.m. at a motel in the 900 block of Harrison Street, in the city's South of Market district, police said.
The victim had answered a knock on his door from a woman who asked to use his bathroom, police said. After using the bathroom, the woman reportedly opened the motel room door for a man outside, who attempted to rob the victim.
A struggle ensued, during which the victim was stabbed by the male intruder several times in the back and hand, spokeswoman Sgt. Lyn Tomioka said.
Both suspects then fled with the man's possessions.
No arrests have been made, and no detailed description of the suspects was available.
The victim was taken to a hospital and is expected to survive, Tomioka said.