While military action suppressed the pirates, a change in Ming maritime policy allowing overseas trade was instrumental in keeping them from rising again. As early as 1530, the maritime prohibitions had in fact been lifted in the southern coastal province of Guangdong, where non-tribute trade was taxed. Provincial authorities had hoped that by opening trade, the economically marginalized of Guangdong would have legitimate livelihoods and would not need to descend into piracy. Indeed, Guangdong was spared from the brunt of the pirate raids during the peak years of wokou activity, and those who had invaded Guangdong were put down with relative ease. In 1554, the provincial authorities entered into an historic agreement with the Portuguese — who came back to Guangdong after their misfortunes at Zhejiang and Fujian — where the Portuguese would be allowed to settle in Macau and trade in Guangzhou for an annual fee. The Portuguese would thence help the Ming destroy pirate fleets in the area, for which they were eventually rewarded with the imperial acknowledgement of their occupation of Macau by the Wanli Emperor (r. 1563-1620). This occupation lasted all the way until 1999, when Macau was handed over to the People's Republic of China.