State administration of Hainan's lowlands was indirect until the Song dynasty and state control of the inland mountains was indirect until the 1950s. By the 11th century, Chinese records state that Hlai people were living close to Chinese settlements and paid taxes to the central state. However by the end of the Ming dynasty in the mid-17th century, virtually all areas of Hainan capable of intense cultivation had been settled by Han Chinese, while the Hlai filled the niche of supplying mountain products. By 1700, the Qing dynasty had re-established administration over Hainan. Migrant merchants started entering Hainan and threatened the economic niche of the Hlai, who broke out in violent protest against these "guest merchants" in 1766.