Liu was elected Magistrate of Miaoli County on 3 December 2005 and took office on 20 December. He won a second term in the 2009 Miaoli County magistrate election.
On 18 September 2013, a shoe was thrown at him by student Chen Wei-ting (陳為廷) when Liu attempted to offer his condolences during the memorial Service to the family of a man named Chang Sen-wen (張森文), who was found dead in a water channel under a bridge at Dapu, Zhunan. Supporters and relatives of Chang held Liu responsible for the his death because his pharmacy was one of several structures destroyed by the county government on 17 July 2013 to make way for the construction of a new campus at the Hsinchu Science Park. On 25 June 2015, the Taichung branch of Taiwan High Court ruled Chen guilty in the shoe-throwing incident but exempted him from any punishment.
The Control Yuan impeached Liu in August 2016 after an investigation found that Miaoli County accrued a debt of NT$67.6 billion under his leadership.