In 1861, Rosecrans joined the Union forces as an aide on the staff of Gen. McClellan as a colonel of engineers. In June 1861, he was elected colonel of the 23rd Ohio Infantry, and received his promotion to brigadier general. During the 1861 campaign through West Virginia, Rosecrans led a brigade at the Battle of Rich Mountain, and afterward, assumed command of the army from General George B. McClellan. In May, he directed the left wing of General John Pope's Army of the Mississippi during the advance on Corinth, and in the subsequent Battle of Shiloh. After Pope was transferred to the Eastern theater, Rosecrans took command of the army. He led his new command into the battles of Iuka and Corinth under the orders of Gen. Ulysses S. Grant. In September 1862, Rosecrans received a promotion to major general and, a month later, he was sent to take command of the Army of the Cumberland. He led his forces to victory at the battle Murfreesboro, and after six months, pursued the enemy through Middle Tennessee in June 1863. Later, in August 1863, Rosecrans led his men into the Battle of Chickamauga, and the subsequent battle of Chattanooga. In October, he was replaced by General Grant and transferred to the Department of Missouri in 1864 before he left active duty in 1865.