Martin was an early advocate of American independence from Great Britain. In the fall of 1774, as a resident of Somerset County, Maryland, he served on the county's patriot committee, and in December attended a convention of the Province of Maryland in Annapolis, which had been called to consider the recommendations of the American Congress.
Martin married Maria Cresap (daughter of Captain Michael Cresap) on Christmas Day 1783. Of their five children, three daughters lived to adulthood. An extended display of his eloquence and volubility appears in "Modern Gratitude in Five Numbers: Addressed to Richard Raynall Keene, Esq. Concerning a Family Marriage" (1802)—a closely documented, fiercely argued (and partly autobiographical) denunciation of a former protégé who, against Martin's express wishes, had wooed and married Martin's daughter Eleonora.
In 1785, he was elected to the Confederation Congress by the Maryland General Assembly, but his numerous public and private duties prevented him from traveling to Philadelphia.
In an address to the Maryland House of Delegates in November 1787 and in numerous newspaper articles, Martin attacked the proposed new form of government and continued to fight ratification of the Constitution through 1788. He lamented the ascension of the national government over the states and condemned what he saw as unequal representation in Congress. He owned six slaves of his own but opposed including slaves in determining representation (most slave owners supported counting slaves for the purposes of determining representation - as this would increase the power of Slave States) and believed that the absence of a jury in the U.S. Supreme Court gravely endangered freedom.
Maryland largely ignored Martin's warnings. In April 1788, it voted to ratify the Constitution, the seventh state to do so. In June, when New Hampshire became the ninth state to ratify, the required threshold had been reached, and the new Constitution took effect. Three years later, the first 10 amendments were added. Around 1791, however, Martin turned to the Federalist Party because of his animosity toward Thomas Jefferson, who, in 1807, spoke of him as the "Federal Bull-Dog."
The beginning of the 1800s saw Martin as defense counsel in two controversial national cases. In the first case, Martin won an acquittal for his close friend Supreme Court Justice Samuel Chase in his impeachment trial in 1805. Two years later, Martin was one of Aaron Burr's defense lawyers when Burr stood trial for treason in 1807.
After a record 28 consecutive years as state attorney general, Martin resigned in December 1805. In 1813, he became chief judge of the court of oyer and terminer for the City and County of Baltimore. He was reappointed attorney general of Maryland in 1818, and, in 1819, he argued Maryland's position in the landmark Supreme Court case McCulloch v. Maryland. The plaintiffs were represented by Daniel Webster, william Pinkney and william Wirt.
Martin's fortunes declined dramatically in his last years. Alcoholism, illness, and poverty weighted heavily on Martin, taking their toll as he aged. By the mid-1820s, he was subsisting on a special tax imposed on Maryland lawyers solely for his personal support. Eventually, he was taken in by Aaron Burr, whom he had defended at this disgraced ex-vice president's 1807 trial for treason. By this time, detestation of Thomas Jefferson, his one-time decentralist ally, led Martin to embrace the Federalist Party, in apparent repudiation of everything he had argued for so strenuously. Paralysis, which had struck in 1819, forced him to retire as Maryland's attorney general in 1822.
On July 8, 1826, at the age of 78, he died in Aaron Burr's home in New York City and was buried in an unmarked grave in St. John's churchyard. His death came four days after the deaths on July 4 of Jefferson and John Adams.