A student from the border state of Missouri, Farrar sided with the Union, was appointed provost-marshal-general of St. Louis, and became Colonel of the 13th Regiment Missouri Infantry. On January 21, 1864, he transferred his command to an African-American regiment the 6th United States Colored Heavy Artillery--and participated with his troops in skirmishes and expeditions in Louisiana and Mississippi, helping hold the area for the Union while Sherman took his seasoned veterans on their march to Atlanta and the sea. In March of 1865 he was breveted a brigadier general.