In September 1845, Grant's Fourth Infantry Regiment went to war. Although the army, under the command of General Zachary Taylor, was officially only an army of observation designed to ensure the uneventful annexation of Texas, few doubted that the army would soon become active militarily. As Grant later wrote, "We were sent to provoke a fight, but it was essential that Mexico should commence it." In fact, in September the army boarded ships in Louisiana and sailed for Corpus Christi, Texas, where it became an army of occupation. The three thousand soldiers set up a neat camp outside the town, and Grant participated in the plays directed by his West Point friend James Longstreet–who went on to become the second- in-command of the Confederate Army in the Civil War.
When the presence of the U.S. Army in Corpus Christi failed to entice the Mexican army to battle, Taylor marched his army 150 miles to the Texas border at the Rio Grande. Grant, for one, did not support the American approach, later commenting that he felt the resulting war was one of the most "unjust" ever waged.
On May 3, 1846, the Americans got the war they came for. Mexican General Mariano Arista opened fire on the American positions with artillery. Grant, twenty-five miles away on the coast, could hear the gunfire and "felt sorry" he had enlisted. As he returned to the beleaguered force, he and the rest of Taylor's army met a large Mexican force–Grant's first experience in battle. The Mexicans, although superior in number, found themselves hopelessly outgunned by the American howitzers, which tore large holes in the Mexican ranks. Grant escaped from the encounter unharmed, although he saw his first man die in combat when a cannon shell exploded nearby, killing one and injuring Grant's captain.
Grant's accounts of the incidents, and later his accounts of dozen more battles, were always matter-of-fact, devoid of emotion, recording only the incident and never his thoughts. The next day, Grant went again into battle, near Resaca de la Palma, although as a quartermaster he was meant to stay away from the front lines. However, he found a clear area with several Mexican soldiers and charged his company across the field, meeting no resistance. The battle ultimately drove the Mexicans back across the Rio Grande, and the next day Taylor crossed the river with his own army and seized Matamoros.
In August 1846, Taylor made a move towards Monterrey, the largest city in the area. The heat forced the army to travel at night and contributed to a general lethargy among the pack animals–which became Grant's problem as quartermaster. His treatment of the situation underscored one of his character traits, that he never is known to have uttered an expletive: "I am not aware of ever having used a profane expletive in my life; but I would have the charity to excuse those who have done so, if they were in charge of a train of Mexican pack animals at the time." As with everything else, Grant approached the pack animals as detached and emotionless, not allowing himself to get worked up enough to curse.
At Monterrey, Grant participated in the attack on the Black Fort, the city's main defense. Almost a third of the American force was killed or wounded in the first assault, and the Army regrouped at a different location. Grant, who had commandeered a horse for the first charge, offered it to another officer and grabbed another mount from his quartermaster contingent. In the second charge, the first officer was killed, and Grant–as the only other mounted officer–became the new commander for the detachment. Grant and his troops fought a house-to-house battle through the city, and the entire force took heavy losses. A negotiated peace allowed the Mexicans to retreat from the city with their weapons, much to Taylor's chagrin.
Nonetheless, the battle had been enough of a success to boost Taylor's fame across the country, and he began to be talked about as a possible Presidential candidate. The other main general in the army, Winfield Scott–who considered himself a better politician–began to protest that he too needed to be involved in the war. What had started out as a political war was now in danger of being completely bogged down in internal bickering.
When Scott finally got the go-ahead in March 1847, he moved his army to Veracruz and marched on Mexico City. Grant's unit went to Veracruz to assist. Scott, outnumbered by the Mexican army, left Veracruz without waiting for a supply line and marched for the capital city–a tactic that Grant would later use at Vicksburg. When peace negotiations failed, Scott's army fought two deadly battles at Chapultepec and Molino del Rey. At San Cosme, Grant earned his own note of the battle when he led a group of troops to capture a church and mount a cannon in the belfry where it could fire on distant Mexican troops–the incident even earned a brief mention in the dispatches to Washington. The U.S. Army won the day handily, and Mexico arraigned to transfer Texas, New Mexico, and California to the U.S. for fifteen million dollars. While Grant's own role in the war was remarkably uneventful, his first experience taught him much about leadership, command, and military tactics. He would ultimately follow some of Scott's tactics and later adopted Taylor's unpretentious dress during the Civil War.
Grant remained in Mexico for several months, enjoying the sights, learning Spanish, hiking, and exploring. He loved the country and was surprised by the lack of resentment he felt from its people. He wrote Julia often, waxing about the beauty of the area. However, when orders came to return to the U.S., Grant happily set out to reunite with his love. After a promotion to Brevet Captain, Grant was returned to base in St. Louis.