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.