<P> As the American diplomat Benjamin Franklin reported from Paris to the Congressional Committee of Secret Correspondence in March 1777, the Spanish court quietly granted the rebels direct admission to the rich, previously restricted port of Havana under most favored nation status . Franklin also noted in the same report that three thousand barrels of gunpowder were waiting in New Orleans, and that the merchants in Bilbao "had orders to ship for us such necessaries as we might want ." </P> <P> The Spanish - Portuguese War (1776 - 77) proved successful . In the First Treaty of San Ildefonso, signed on 1 October 1777, after Mary I of Portugal had dismissed Pombal, Spain won the Banda Oriental (Uruguay), with Colonia del Sacramento, founded by Portugal in 1680 . Spain also won the Misiones Orientales . In return, Spain acknowledged that Portuguese territories in Brazil extended far west of the line set in the Treaty of Tordesillas . In the Treaty of El Pardo, signed 11 March 1778, Spain won Spanish Guinea (Equatorial Guinea), which was administered from Buenos Aires in 1778 - 1810 . With these treaties, Portugal had left the war, and in 1781 Portugal even joined the First League of Armed Neutrality to resist British seizures of cargo from neutral ships . </P> <P> The former Spanish Prime Minister and then - Ambassador to the French Court, Jerónimo Grimaldi, 1st Duke of Grimaldi, summarized the Spanish position in a letter to Arthur Lee, an American diplomat in Madrid who was trying to persuade the Spanish to declare an open alliance with the fledgling United States . Genoese by birth and a shrewdly calculating politician by nature, Grimaldi demurred, replying, "You have considered your own situation, and not ours . The moment is not yet come for us . The war with Portugal--France being unprepared, and our treasure ships from South America not being arrived--makes it improper for us to declare immediately ." Meanwhile, Grimaldi reassured Lee, stores of clothing and powder were deposited at New Orleans and Havana for the Americans, and further shipments of blankets were being collected at Bilbao . </P> <P> By June 1779 the Spanish had finalized their preparations for war . The British cause seemed to be at a particularly low ebb . The Spanish joined France in the war, implementing the Treaty of Aranjuez signed in April 1779 . </P>

When did the united states declare war on spain