In 1846, the United States rejected the terms of the Oregon Treaty, and subsequently, the British Empire declared war on the United States. Britain signed a treaty with the Republic of Mexico, and General Santa Anna promptly invaded Texas. Governor Sam Houston called for volunteers, and President James Polk immediately sent an army to Texas under General Zachary Taylor. Meanwhile, the British sent warships to control the Columbia River, St. Lawrence River, Mississippi River, and the Chesapeake Bay.
What ultimately happened was quite shocking to Mexico and Britain. On all fronts, both the Mexicans and the British were soundly defeated, despite having numerical superiority and quality arms. The war lasted four years, and within that time, the industrial production of the northern states in the U.S. accelerated dramatically, exceeding Britain by 1849. The United States mobilized into a total war effort in which both Canada and Mexico were utterly defeated. Mexico City was conquered in 1847 and Montreal and Toronto in 1848. The British Empire was vanquished and forced to leave the North American continent. The United States won every battle with both Mexico and Great Britain, an outcome that was a shock, especially to the British. In 1850, the United States had the most powerful army and navy in the world, and the British Empire was shown to be a second-rate power.
In 1852, the United States entered upon a period of naval expansion and armament, building ironclad ships and increasing its fleet sixfold. When India revolted in 1857, the United States threatened to declare war on the British Empire if it undertook any military action in India. To the world's surprise, the British backed down and ceded all of the Indian subcontinent to India.
The United States, in 1859, signed the Treaty of Veracruz, in which it returned all of the land it received due to the War of 1846, in exchange for Baja California. In addition, it was agreed upon that some of the territories would be of perpetual joint occupation between the U.S. and Mexico, with open immigration and dual citizens being subject to Mexican law in all cases not involving U.S. citizens.
By 1860, the United States had become a nation that encompassed all of the land in North America above the 30th parallel. Furthermore, by 1862, the U.S. purchased Alaska, discovered gold in California, built the transcontinental railroad, as well as purchasing Greenland. The gross domestic product of the United States was twice that of its nearest competitor, Great Britain, and was growing faster than any other nation.