In 1836, Texas had declared independence from Mexico. Until 1844, Texas kept trying to become a part of the United States of America. In 1844, the U.S. Congress finally agreed to make Texas the 28th state of U.S.A. Mexico didn’t like it and still considered Texas a part of its territories.
This led to a war between USA and Mexico. The war began in 1846 and continued all the way until 1847. Most of the war was fought inside the border of Mexico. American government wanted to force Mexico to accept the independence of Texas and end the war. This objective was finally achieved when the American forces captured the city of Mexico City.
Mexico City was the capital of Mexico, so the city was very important for both sides. If the American forces captured the city, they could force the Mexican government to end the war. If the Mexicans lost the city, they were sure to lose the war as well.
So both sides were determined to have control of the city. The Battle for Mexico City took place in September, 1847. It comprised a number of minor battles during which the American forces steadily advanced and took the castles around the city one by one before reaching the city.
The American forces started their attack on Mexico City on September 8, 1847. Before reaching the city, the American army first needed to take control of the Mexican batteries located outside the city.
For this purpose, Americans first attacked the Molino del Rey, located at 2 miles from the city. This was a cannon foundry and after heavy fighting, Americans were able to take control of the mill. Next, the American army attacked the Chapultepec Castle. This castle guarded the city and was also a Mexican military academy. After multiple attacks, American army gained control of the castle and the Mexican army retreated into the city.
On September 15, American army had reached the city gates and entered it. The Mexican army, after suffering many defeats, had retreated from the city and left it unguarded. So when the American army entered Mexico City, it faced no opposition. The Americans took control of most of the important positions within the city including the National Palace, hoisting the U.S. flag in place of the Mexican flag.
Mexico City was one of the most important cities in Mexico. Losing it was a major setback for the Mexicans. Although the war continued until 1848, the control of the Mexico City by the American army proved that the American army was winning the war.
When the Mexican army continued to suffer further defeats and the American army continued to advance, Mexico was forced to negotiate for peace with the US government. This resulted in the Treaty of Guadalupe Hidalgo which was signed in February, 1848, bringing an end to the hostilities. In this treaty, Mexico officially accepted the independence of Texas and ceded many territories to U.S.A.