The fire at 2949 18th St. at about 8 a.m. on Jan. 28 was quickly extinguished, according to the fire department.
According to police reports, Willie Tucker, a transient, is believed to have set the fire outside an apartment door of a female resident, who had reportedly befriended him months ago and given him food.
The words "Wecome hell" and other illegible writing were found scrawled on the door in permanent marker.
No one was injured, and the fire damaged only a doormat and part of the door of the apartment, according to police spokesman Officer Samson Chan.
Chan said it was unknown why the Tucker allegedly set the fire. He said it was fortunate the fire was quickly put out, as it could have spread to the rest of the 121-unit building.
Tucker was arrested on Monday on Erie Alley between South Van Ness Avenue and Folsom Street.
"When he was confronted by the officers, he did put up a fight," Chan said.
Prosecutors have charged Tucker with felony arson of an inhabited dwelling and misdemeanor resisting arrest, according to the district attorney's office.
Chan said Tucker has "a lengthy criminal history" going back decades, but that his prior arrests did not include arson.