Holmes, a Democratic-Republican, was elected to the Massachusetts General Court in 1802, 1803, and 1812.
He was elected to the Massachusetts State Senate in 1813 and 1814.

In 1816, Holmes was one of the commissioners under the Treaty of Ghent to divide the islands of Passamaquoddy Bay between the United States and Great Britain.
He was also appointed by the legislature to organize state prisons and revise the Massachusetts criminal code.

Holmes was elected as a United States Representative from Massachusetts in 1816, serving from March 4, 1817, to his resignation on March 15, 1820.
During the 16th Congress, Holmes served as chairman of the Committee on Expenditures in the Department of State.
Holmes supported William H. Crawford, (a "Crawford Republican"), and John Quincy Adams.
He was opposed to Andrew Jackson (an "Anti-Jackson").

Holmes supported the Missouri Compromise, and was praised by Thomas Jefferson for his pamphlet Mr. Holmes's Letter to the People of Maine.
In the letter, Jefferson thanks Holmes for a copy of this pamphlet.
This pamphlet defends Holmes's position on supporting the Missouri Compromise—the admission of Maine as a free state with the admission of Missouri as a slave state, which was an unpopular position in Maine.
This letter is also notable for being the first written attestation of the phrase "to have the wolf by the ear".
Jefferson himself rejected the compromise:
But this momentous question, like a fire bell in the night, awakened and filled me with terror.
I considered it at once as the knell of the Union.
it is hushed indeed for the moment.
but this is a reprieve only, not a final sentence.
a geographical line, coinciding with a marked principle, moral and political, once conceived and held up to the angry passions of men, will never be obliterated; and every new irritation will mark it deeper and deeper. (...)
An abstinence too from this act of power would remove the jealousy excited by the undertaking of Congress, to regulate the condition of the different descriptions of men composing a state.
this certainly is the exclusive right of every state, which nothing in the constitution has taken from them and given to the general government.
could congress, for example say that the Non-freemen of Connecticut, shall be freemen, or that they shall not emigrate into any other state?

— Letter by Thomas Jefferson to John Holmes, April 22, 1820
Holmes was later a delegate to the Maine Constitutional Convention.
Upon separation from Massachusetts and the admission of Maine as a state, he was elected to the United States Senate and served from June 13, 1820, to March 3, 1827.
Holmes was again elected to the Senate to fill the vacancy caused by the resignation of Albion Parris, serving from January 15, 1829, to March 3, 1833.
During the 17th Congress, Holmes served as chairman of the Committee on Finance (1821–1822); during the 21st Congress, Holmes was chairman of the Committee on Pensions.

After leaving the Senate, Holmes resumed his law practice.
From 1836 to 1837, he was a member of the Maine House of Representatives.
In 1841, Holmes was appointed as the United States Attorney for the District of Maine, a post he held until his death in Portland on July 7, 1843.
Holmes, a Democratic-Republican, was elected to the Massachusetts General Court in 1802, 1803, and 1812. He was elected to the Massachusetts State Senate in 1813 and 1814.
In 1816, Holmes was one of the commissioners under the Treaty of Ghent to divide the islands of Passamaquoddy Bay between the United States and Great Britain. He was also appointed by the legislature to organize state prisons and revise the Massachusetts criminal code.
Holmes was elected as a United States Representative from Massachusetts in 1816, serving from March 4, 1817, to his resignation on March 15, 1820. During the 16th Congress, Holmes served as chairman of the Committee on Expenditures in the Department of State. Holmes supported William H. Crawford, (a "Crawford Republican"), and John Quincy Adams. He was opposed to Andrew Jackson (an "Anti-Jackson").
Holmes supported the Missouri Compromise, and was praised by Thomas Jefferson for his pamphlet Mr. Holmes's Letter to the People of Maine. In the letter, Jefferson thanks Holmes for a copy of this pamphlet. This pamphlet defends Holmes's position on supporting the Missouri Compromise—the admission of Maine as a free state with the admission of Missouri as a slave state, which was an unpopular position in Maine. This letter is also notable for being the first written attestation of the phrase "to have the wolf by the ear". Jefferson himself rejected the compromise:
But this momentous question, like a fire bell in the night, awakened and filled me with terror. I considered it at once as the knell of the Union. it is hushed indeed for the moment. but this is a reprieve only, not a final sentence. a geographical line, coinciding with a marked principle, moral and political, once conceived and held up to the angry passions of men, will never be obliterated; and every new irritation will mark it deeper and deeper. (...) An abstinence too from this act of power would remove the jealousy excited by the undertaking of Congress, to regulate the condition of the different descriptions of men composing a state. this certainly is the exclusive right of every state, which nothing in the constitution has taken from them and given to the general government. could congress, for example say that the Non-freemen of Connecticut, shall be freemen, or that they shall not emigrate into any other state?
— Letter by Thomas Jefferson to John Holmes, April 22, 1820
Holmes was later a delegate to the Maine Constitutional Convention. Upon separation from Massachusetts and the admission of Maine as a state, he was elected to the United States Senate and served from June 13, 1820, to March 3, 1827. Holmes was again elected to the Senate to fill the vacancy caused by the resignation of Albion Parris, serving from January 15, 1829, to March 3, 1833. During the 17th Congress, Holmes served as chairman of the Committee on Finance (1821–1822); during the 21st Congress, Holmes was chairman of the Committee on Pensions.
After leaving the Senate, Holmes resumed his law practice. From 1836 to 1837, he was a member of the Maine House of Representatives. In 1841, Holmes was appointed as the United States Attorney for the District of Maine, a post he held until his death in Portland on July 7, 1843.
John Holmes (Maine politician)