In the early 19th century, conflicts between
Zhangzhou and
Quanzhou settlers in Yuanli caused the two groups to separate themselves, with the former occupying current-day downtown Yuanli and the latter in Fangli, a few kilometers south.
City walls were built around Fangli in 1855 to fend off the rival Zhangzhou population. Since the area's original Mazu temple, , was located outside of the walls in Zhangzhou territory, Quanzhou settlers built their own Mazu temple within Fangli in 1856, naming it Shuntian Temple. The two temples became the cultural centers of their respective population; Shuntian Temple was known as the "Mazu inside the walls" (城內媽祖), while Cihe Temple was the "Mazu outside the walls" (城外媽祖). On 21 October 2010, Shuntian Temple was protected by the
Miaoli County Government as a historical building. == Architecture ==