Jiufen is a mountain town in the Rueifang Township of Taipei County near Keelung, Taiwan.
During the first years of the Qing Dynasty, the village here housed nine families, thus the village would request "nine portions" every time shipments arrived from town. Later Jioufen ("Nine portions" in Chinese) would become the name of the village.
Jioufen was only an isolated village until 1893, when gold was discovered in the area. The resulting gold rush hastened the village's development into a town, and reached its peak during the Japanese rule. Many present features of Jioufen reflect the era under Japanese colonization, with many Japanese inns surviving to this day. During World War II, a POW camp named Kinkaseki was set up in the village, holding Allied soldiers captured in Singapore (including many British) who worked in the nearby gold mines. Gold mining activities declined after World War II, and the mine was shut off in 1971. Jioufen quickly went into decline, and for a while the town was mostly forgotten.
In 1989, Hou Hsiao-hsien's A City of Sadness, the first film to touch on the 228 Incident, a taboo subject in Taiwan, became a big hit in the theatres. As a result Jioufen, where the film was set, revived due to the film's popularity. The nostalgic scenery of Jioufen as seen in the film, as well as appearances in other media, charmed many people into visiting Jioufen. For the beginning of the 90s, Jioufen experienced a tourist boom that has shaped the town as a tourist attraction. Soon retro-Chinese style cafés, tea houses, and souvenir stores bearing the name "City of Sadness" were built.
Jioufen also became popular for Japanese tourists since 2001, when its downtown was used as a model in the anime movie Spirited Away.
At present, Jioufen is a renowned tourist attraction representative of Taiwan. It draws many tourists from Taipei during the weekends.