During his tenure as Secretary of State in the cabinet of James Monroe, the debate on the Missouri Compromise occurred in 1820. During that debate, Adams strongly disagreed with his friend John C. Calhoun, who became the most outspoken national leader in favor of slavery. Their relationship changed from a friendship to becoming bitter enemies. Calhoun believed that the right to own slaves had to be protected from interference from the federal government in order to keep the nation alive, while Adams saw slavery as contrary to the principles of republicanism and as a moral wrong. Adams predicted that if the South formed a new nation, it would be torn apart by a violent slave insurrection. If the two nations went to war, Adams predicted the president of the United States would use its war powers to abolish slavery.
During his term as President, the issue of slavery did not come to the forefront and the status quo remained temporarily settled as a result of the Missouri Compromise. When Adams lost his bid for re-election, the possibility of southern succession arose when Calhoun threatened that southern states would leave the union over the so-called Tariff of Abomination. President Andrew Jackson threatened to lead an army if the south threatened to secede and for the time being it appeared that both slavery and the union would remain intact.
In 1841, during the Presidency of Martin Van Buren, Adams represented the defendants in the landmark case of United States v. The Amistad Africans before the Supreme Court of the United States. He successfully argued that the Africans, who had seized control of a Spanish ship, La Amistad, on which they were being transported illegally as slaves, should not be extradited or deported to Cuba, but should be considered free. The government had argued that the Africans should be deported for having mutinied and killed officers on the ship. Adams won their freedom, and his clients were given the choice to either stay in the United States or return to Africa. He never billed for his services in the case. His argument before the justices of the court included an attack on the evils of slavery.
Adams had been elected to the United States House of Representatives in the 1830 elections as a National Republican. He was elected to eight terms, serving as a Representative for 17 years, from 1831 until his death in 1848. He became the leading antislavery voice in the Congress. His attack on the institution was so relentless that in 1836, southern congressmen voted in a rule, called the "gag rule," that called for the immediate tabling of any petitions about slavery. Congress had been flooded with petitions signed by citizens protesting slavery, with most originating from the Anti-Slavery Society based in New York.
The Gag rule prevented discussion of slavery from 1836 to 1844, but Adams frequently managed to evade it by his knowledge of parliamentary procedure. He refused to honor the House’s gag rule banning discussion or debate of the slavery issue and he evaded and ignored the gag rule until his persistence irritated his colleagues to the point that he was threatened with censure. The strategy backfired as Adams used this as an opportunity to speak at length against slavery in the course of the debate. The House never voted to censure Adams, and the discussion ignited by his actions and the attempts of others to quiet him raised questions of the right to petition, the right to legislative debate, and the morality of slavery. During the debate, Adams said that he was pleased that southerners would forever remember him as "the acutest, the astutest, the archest enemy of southern slavery that every existed".
Adams presented anti-slavery petitions in the House from the time he was first elected to the Congress. He considered it an issue of freedom of speech. He said that he personally disagreed with the demands for immediate abolition contained in the petitions, but he defended the right for the petitioners to be heard. The numbers of petitions approached the tens of thousands in the first months of 1836. When the "gag rule" was adopted and the presentation of any associated petitions were banned, all such petitions were tabled. Adams turned the issue from one of slavery to a debate on the propriety of the house censoring discussion of an important national issue. Adams demanded that the petitions be reviewed to determine if they violated the gag rule. He argued that the gag rule could not apply to petitions tabled before the rule came into effect. This argument was rejected and the gag rule applied retroactively. He tried a number of other tricks, but the gag rule prevailed.
On one occasion Adams asked for clarification as to whether it was within the rules of the House to present a petition signed by twenty-two enslaved persons. His question created pandemonium in the House. Congressman Dixon Hall Lewis of Alabama offered a motion that Congressman Adams be punished. Congressman Waddy Thompson brought a motion to censure the former president. The motion read:
Resolved, that J.Q. Adams, a member from the State of Massachusetts, by his attempt to introduce into this House a petition of slaves for the abolition of slavery in the District of Columbia, committed an outrage on the rights and feelings of a large portion of the people of the Union, a flagrant contempt on the dignity of this House; and by extending to slaves a privilege only belonging to freemen, directly incites the slave population to insurrection; and that the said member be forthwith called to the bar of the House, and censured by the Speaker.
Adams’ responded first with as an intentionally understated attempt at correcting the misinformation in the censure proposal. Adams said: "The resolution charged him with attempting to present a petition from slaves asking for the abolition of slavery in the District of Colombia. In the first place, he would remind the House that he had not attempted to present the petition; he had simply asked for a ruling by the Speaker about the status of such a petition under the Hawes resolution". He also took issue with the claim that the petition was for the abolition of slavery. He said that the petition was actually not asking for the members to consider abolishing slavery, but in fact was supplicating in favor of the opposite view. Some members of the House believed that Adams was acting in contempt of the rules and decorum of the body. Many of the members of the House rose to publicly condemn Adams, but not all felt that he should be censured. Even two representatives of slaveholding states suggested that a censure of Adams could be conceived as an attack on the liberty of speech. The only two congressmen to vocally defend Adams during the debate over censuring him were his Massachusetts colleagues: Caleb Cushing and Levi Lincoln.
Adams took advantage of his right to defend himself in front of the members to speak for days against slavery and in favor of abolition. He spoke against the slave trade and the ownership of slaves. Adams went so far as to suggest the dissolution of the Union. As others continued to attack him and call for his censure, Adams continued to debate the issues of slavery and the evils of slaveholding. Adams had in effect lifted the gag rule by debating slavery on the House floor as part of his defense against censure.
On February 8, 1837, the United States House of Representatives voted to table the motion to censure Representative Adams. No further motion personal to Adams concerning his issue was accepted by the House.
In 1846, the 78-year-old former president suffered a stroke that left him partially paralyzed. He made a full recovery and resumed his duties in Congress. On February 21, 1848, the House of Representatives was discussing the matter of honoring U.S. Army officers who served in the Mexican–American War. Adams had been a strong critic of the war, and as Congressmen rose up to say, "Aye!" in favor of the measure, he instead yelled, "No!" He rose to answer a question put forth by the Speaker of the House. He then collapsed, having suffered a massive cerebral hemorrhage. Two days later, on February 23, he died with his wife and youngest son at his side in the Speaker's Room inside the Capitol Building in Washington, D.C. His last words were "This is the last of earth. I am content." He died at 7:20 p.m. An little-known rookie congressman named Abraham Lincoln was assigned to the committee making the funeral arrangements.