The conflict ended quickly when the defeated and demoralized Portuguese were forced to negotiate and accept the stipulations of the Treaty of Badajoz, signed on June 6, 1801. As part of the peace settlement, Portugal recovered all of the strongholds previously conquered by the Spanish, with the exception of Olivença and other territories on the eastern margin of the Guadiana, and a prohibition of contraband was enforced near the border between the two countries. The treaty was ratified by the Prince-Regent on 14 June, while the King of Spain promulgated the treaty on 21 June.