Though no major battles were fought in New Jersey, soldiers and volunteers from New Jersey played an important part in the wars fought by the United States of America. During the Mexican–American War, a battalion of volunteers from New Jersey, in four companies, was active from September 1847 to July 1848. Philip Kearny, an officer who led a cavalry unit, followed General Winfield Scott and fought in the Battle of Contreras and Battle of Churubusco. After the war, Kearny made his home in the state of New Jersey. George B. McClellan was an important general during the Civil War, and was elected governor of New Jersey in 1877, serving in office from 1878 to 1881.