During his stay at Walden Pond (later to become the subject of his published journal Walden, or Life in the Woods), Thoreau spent one night in jail for refusing to pay a poll tax meant to support America's war with Mexico. He composed a letter from jail that he would later integrate into Civil Disobedience, published in 1849 under the title Resistance to Civil Government. (It is interesting to note that the term "civil disobedience" does not appear in the actual essay.) Thoreau's incarceration brought him firsthand knowledge of the coercive and oppressive tactics used by government to compel its citizens into support of immoral and unjust policies. But it also highlighted the importance of individual moral conscience. The experience became the point of departure for Thoreau's much broader reflection on the duty of civil disobedience.
In addition to the war with Mexico, slavery is a chief concern in Thoreau's essay. He extends the logic of his argument about civil disobedience to include any cause that might violate an individual's sense of moral conscience. At the time of publication, the country was deeply divided along regional (and racial) lines over the question of slavery. The New England Anti-Slavery Society had been founded in 1832, and by the 1840s, Boston and the town of Concord where Thoreau lived for most of his life were considered bastions of abolitionist sentiment. Civil Disobedience was first delivered on January 26, 1848 as a lecture at the Concord Lyceum, a center of education for reform-minded thinkers and citizens. While the need for abolition seems morally self-evident by contemporary standards, the issue of slavery in the 1840s and 1850s did not command a unified opinion among many white Americans, even in northern states. Thoreau's essay made it clear that all citizens are morally implicated in the oppression practiced by a government even if indirectly affected by it.
Thoreau's landmark essay has had a profound and well-documented influence on intellectual figures such as the Russian author Leo Tolstoy, Indian peace activist Mohandas Gandhi, black civil rights leader Martin Luther King Jr., on the British Labor Movement and the American political landscape more generally in the nineteenth and twentieth centuries. King's Letter from Birmingham Jail (1963), while containing no direct reference to it, clearly mimics the format of Thoreau's own letter from jail, and relies on the essay's endorsement of civil disobedience as a legitimate response to oppressive government policies.