Qing An Temple has lived through the turbulence of Keelung's port history. In 1884, during the Sino-French War, French forces occupied Keelung for several months, and the temple narrowly escaped destruction. After the war, Liu Mingchuan asked the Guangxu Emperor for a calligraphy plaque reading Dai De Er Tian. The plaque's whereabouts are unknown today. Under Japanese rule, the processions of Qing An Temple, the City God Temple and Dianji Temple were required to extend to Keelung Shrine for incense offerings. Between 1921 and 1924, they were pushed into a joint procession on the third of June, the shrine's festival day, but from 1925 each temple went its own way again. Then came the Pacific War. Keelung was a major port, and heavy American air raids damaged the temple badly. Legend tells that the founding Third Mazu of Nanyao Temple in Changhua appeared as a woman in the sky and caught the bombs in her skirt, protecting the people of Keelung. In gratitude, Qing An Temple invites that Mazu to Keelung each year before Mazu's birthday, on the nineteenth day of the third lunar month, a custom that continues today. Qing An Temple is also the birthplace of the Zhongyuan Festival, Keelung's major celebration. Each year in the seventh lunar month, the temple still serves as its lead host.