The nuns' residence next door to Hua Zang Si temple on 22nd Street was heavily damaged in a fire Tuesday, but luckily firefighters were able to keep the fire from spreading to the temple building next door.

Flames appeared to be coming from the bright-red-painted Hua Zang Si temple Tuesday evening on the 3100 block of 22nd Street. But the building on fire was actually the nuns' residence next door at 3126 Mission  — what was formerly the rectory of the former St. John's Evangelical Lutheran Church. The church became a Chinese Buddhist temple in 2004, home to a congregation that follows the "dharma expounded by Shakyamuni Buddha," the founder of Buddhism.

According to its website, Hua Zang Si conducts services in Chinese, and welcomes Buddhists of all sects, and "Our viewpoint is not limited to a particular sect."

The fire broke out around 5:28 pm, and escalated to two alarms, with around 70 fire personnel on the scene. An hour later, the San Francisco Fire Department said the fire was under control.

According to SFFD Captain Jonathan Baxter, all 15 residents of the building were safely evacuated, and three cats and one dog were rescued between two buildings.

One firefighter suffered minor injuries battling the blaze.

The cause of the fire and the extent of the damage it caused are not yet known.

Update: Mission Local reports that only four of the 15 residents of the building have been displaced, though the reasons for this are unclear. None of the nuns were in the building when the fire started, they said, because they were having a study session in the temple. They called this a "blessing."

The cause of the fire, they said, was accidental and related to construction. The building had a permit, recently issued, for re-roofing, Mission Local reports.

The temple building was built around 1900, and survived the 1906 Earthquake and Fire because it was far enough away from other buildings in the Mission at the time. The church's original German Lutheran congregation dwindled after World War II, and in 1992 the remaining congregants voted to move around the corner and continue serving the neighborhood's growing Latino population. It became the bilingual Santa Maria y Santa Marta Lutheran Church.

The church building was slated to become condominiums before the United International World Buddhism Association purchased it in 2002, and Hua Zang Si came along two years later, along with its bold paint job.