He kept this post throughout his fathers" term of office. After his fathers defeat to Thomas Jefferson he returned home. In 1802 he was elected to the Massachusetts senate, which sent him to the U. S senate the following year. He was also appointed to the Supreme Court, a membership he declined. President James Madison then appointed him to Minister to Russia in 1809.
He continued to serve his country and gained a well-respected reputation. Adding to his reputation was his brilliant and tough-minded performance as chief American peace commissioner during the negotiations at Gent that ended the War of 1812. He also showed effectiveness as the Minister to Great Britain during the last two years of the Madison administration. He continued to distinguish himself by negotiating a treaty with Spain. The Adams-Onis Treaty, concluded on February 22, 1819, provided for the transfer of East and West Florida to the United States. It established a border between Spanish and US territory running from the Gulf of Mexico to the Rocky Mountains and along the forty-second parallel to the Pacific Ocean. Historians regard the treaty as a brilliant act of diplomacy, and close to the end of Adam's life, he called it "the most important event of my life". .
Adams also was the mind behind the Monroe Doctrine, which warned that the United States would oppose any European interference in the internal affairs of an American nation or further European colonization of territory in the Western Hemisphere. There was no doubt that Adams was a deserving candidate for the presidential election of 1824. He had held high diplomatic positions and displayed both aptitude and ability. He wanted to be President, but although Adams was the most distinguished member of the Monroe Cabinet, his success was somewhat neutralized by his lack of friends and organizational backing. He had also earned himself a reputation of being stubborn and inflexible.