The Haijin (Chinese: 海禁; pinyin: Hǎi Jìn; literally: "sea ban") order was a ban on maritime activities imposed during China's Ming dynasty and again at the time of the Qing dynasty. Intended to curb piracy, the ban proved ineffective for that purpose. Instead it imposed huge hardships on coastal communities and legitimate sea traders.[citation needed]

Koxinga, also known as Zheng Chenggong, was an ex-Ming military leader located in the coastal region, a Ming loyalist, and a threat to Qing authority. In 1647, another sea ban was issued to limit foreign trade with severe punishment imposed. In 1655[dubious– discuss] the "Frontier Shift" was imposed in Guangdong, Fujian, Zhejiang, Jiangsu and Shandong. It required coastal residents to move inland 30–50 li (~15 to 25 kilometres (9.3 to 15.5 mi)). All private boats and ships were burned. Small rafts were not allowed at sea. In 1684,[dubious– discuss] the ban was lifted and trading resumed under the Kangxi Emperor. In 1685 a[clarification needed] were made subject to the "Taxation Rules for Sea Trade" as drafted by Yiergetu.[4]

In the second month of the first year (1661) of Kangxi, the Qing court issued an imperial decree: The sea shore inhabitants will be ordered to move inland 50 li, to curb their links with the Taiwan rebels under Koxinga. Soldiers then moved in and set up the boundary: in just three days, all houses were razed to the ground and all inhabitants evacuated.

In the second year (1662) of Kangxi, Hua Officials came to patrol the border, people were moved one more time.

The initial border was considered to be too close to the sea and underwent three successive revisions before it was finally fixed.

Warnings were placed on notice boards stating that "Anyone who dares to step over the border line shall be beheaded!"

"Persons found a few paces over the border line, shall be beheaded instantly."

"All coastal inhabitants should be living less than 20 li from the city. Beyond 20 li, an earthen wall shall be built to serve as a border line; not a single sampan would be allowed to go into the water, no one shall be allowed beyond the border line, any person found shall be executed on the spot. Armed soldiers patrolled the border constantly, would behead anyone caught over the border line.

From 1652 onwards, the Qing court began ordering populations along the entire southern coast to be forcibly relocated inland, to stop them from giving aid and comfort to the enemy through trade. Faced with an enemy in inaccessible areas along the coast, the Qing chose to take the non-state spaces of the littoral to their logical extreme by creating a sanitary cordon of walls and watchtowers between the people and the sea. All coastal navigation and trade was banned, but the effect of the prohibitions and relocations was simply to make the Zheng base in Xiamen an even bigger centre for smuggling trade, with relocated communities now engaging in overland smuggling to Xiamen in order to sustain themselves.

—Yang Shao-yun, Water Worlds : Piracy and Littoral Societies as Non-State Spaces in Late Imperial South China[5]

The ban was also seen as a deceptive proposal, since it prevented the rise of any self-sufficient economies along the coast. Eventually new economies could not be born, and no power was drawn away from the existing imperial courts,[6] thus making this ban a political move.[original research?]