Treaty of Fontainebleau
Spain declared war on Britain in December 1804; Portugal remained neutral until Spain and France signed the 1808 Treaty of Fontainebleau dividing Portugal between them. The Treaty of Badajoz contained a clause stating any breach of its terms rendered it void; Portugal declared the Treaty of Fontainebleau constituted such a breach and nullified the agreement. This is one reason Portugal disputes Spanish sovereignty over Olivença, the other being that its occupation contravenes the 1815 Treaty of Vienna.