War is God’s way of teaching Americans geography.
— Ambrose Bierce,
At the outset of the American Civil War, Bierce enlisted in the Union Army's 9th Indiana Infantry Regiment. He participated in the Operations in Western Virginia campaign (1861), was present at the "first battle" at Philippi and received newspaper attention for his daring rescue, under fire, of a gravely wounded comrade at the Battle of Rich Mountain. In February 1862 he was commissioned First Lieutenant, and served on the staff of General William Babcock Hazen as a topographical engineer, making maps of likely battlefields.
Bierce fought at the Battle of Shiloh (April 1862), a terrifying experience that became a source for several later short stories and the memoir "What I Saw of Shiloh". In June 1864, he sustained a serious head wound at the Battle of Kennesaw Mountain, and spent the rest of the summer on furlough, returning to active duty in September. He was discharged from the army in January 1865.
His military career resumed, however, when in mid-1866 he rejoined General Hazen as part of the latter's expedition to inspect military outposts across the Great Plains. The expedition proceeded by horseback and wagon from Omaha, Nebraska, arriving toward year's end in San Francisco, California.