Until the end of the nineteenth century, the United States had a special relationship, primarily with nearby Mexico and Cuba. Otherwise, relationships with other Latin American countries were of minor importance to both sides, consisting mostly of a small amount of trade. Apart from Mexico, there was little migration to the United States, and little American financial investment. Politically and economically, Latin America (apart from Mexico and the Spanish colony of Cuba) was largely tied to Britain. The United States had no involvement in the process by which Spanish possessions broke away and became independent around 1820. In cooperation with and help from Britain, the United States issued the Monroe Doctrine in 1823, warning against the establishment of any additional European colonies in Latin America.
Texas, settled primarily by Americans, fought a successful war of independence against Mexico in 1836. Mexico refused to recognize the independence and warned that annexation to the United States meant war. Annexation came in 1845 and war in 1846. The American military was easily triumphant. The result was the American purchase of New Mexico, Arizona, California and adjacent areas. About 60,000 Mexicans remained in the new territories and became US citizens. France took advantage of the American Civil War (1861–65), using its army to take over Mexico regardless of strong American protests. With the US victorious in the war, France pulled out, leaving its puppet emperor to his fate in front of a Mexican firing squad.
The Anglo-Venezuelan boundary dispute of Guayana Esequiba in 1895 asserted for the first time a more outward-looking American foreign policy, particularly in the Americas, marking the United States as a world power. This was the earliest example of modern interventionism under the Monroe Doctrine in which the USA exercised its claimed prerogatives in the Americas.
As unrest in Cuba escalated in the 1890s the United States demanded reforms that Spain was unable to accomplish. The result was the short successful Spanish–American War of 1898, in which United States acquired Puerto Rico, and set up a protectorate over Cuba under the Platt Amendment rule passed as part of the 1901 Army Appropriations Bill. The building of the Panama Canal absorbed American attention from 1903. The US facilitated a revolt that made Panama independent, and set up the Panama Canal Zone as an American owned and operated district that was finally returned to Panama in 1979. The Canal opened in 1914, and proved a major factor in world trade. United States paid special attention to protection of the military approaches to the Panama Canal, including threats by Germany. Repeatedly it seized temporary control of several countries, especially Haiti and Nicaragua.