In its early days, Mailiao produced barley and wheat in abundance. To make it easier to transport seeds of barley and wheat, farmers built a hut near the wharf to store piles of them. People at the time called this hut Maitsuliao (literally the hut for storing seeds of barley and wheat). This is the origin of the name, Mailiao. After the restoration of Taiwan in 1945, Mailiao was subordinate to Mailiao of Lunbei Township, Huwei District, Tainan County, and was divided into Southern Village and Northern Village. Back then, it was more than 10 km away from the Township Government Center. The local gentry strived for its establishment as a township. In 1946, Mailiao was separated politically from Lunbei, and Mailiao Township was officially established. In 1950, Yunlin County was established. Douliu, Huwei, and Beigang Districts that were subordinate to Tainan County became subordinate to Yunlin County. Mailiao Township has since become subordinate to Yunlin County.