In April 1861, the Civil War broke out. Whitman's brother George enlisted with the Union army. When Whitman received a report that his brother had been wounded, he rushed down to Washington, D.C. to be with him. He was relieved to find that his brother was all right, but appalled to see how many soldiers were suffering and dying for lack of medical care. Whitman volunteered as a military nurse. He was a trusted and well-liked nurse, caring for soldiers' wounds and offering them comfort when they were ill, frightened and far from home.
The war ended in April 1865. Less than a week after the surrender of the Confederacy, President Abraham Lincoln was assassinated at Ford's Theater. Whitman composed two poems, "When Lilacs Last in the Door-yard Bloom'd" and "O Captain! My Captain!" to commemorate the fallen leader.
Whitman decided to stay on in Washington D.C. after the war. He got a job as a clerk in the Indian Affairs Bureau of the Department of the Interior. He liked the work, and kept a draft of Leaves of Grass at his desk to work on in the off-hours. Inevitably, his boss James Harlan got wind of it. When Harlan read the poems, he was horrified by their content. He fired Whitman in June 1865, saying that his off-hours project violated "the rules of decorum and propriety prescribed by a Christian Civilization." (Harlan also fired several other employees who he felt exhibited moral weakness.) An outraged Whitman immediately got another job at the U.S. Attorney's office, but was determined to salvage his reputation. With his friend William D. O'Connor, Whitman wrote and published The Good Gray Poet, a defense of Whitman in the wake of his firing from the Interior.