When the revolutionary war broke out, 17 year old James Monroe was a student at the College of William and Mary. He left school to join the Continental Army. His regiment served with George Washington and he was with Washington for the crossing of the Delaware and at the Battle of Trenton. Monroe was wounded at the battle, and after recovering from his wound, he spent the rest of the war recruiting. Monroe studied law under Thomas Jefferson from 1781 to 1783, but elected to pursue a career in politics instead.
James Monroe was elected to the Virginia House of Delegates in 1782. He was elected to Congress in November 1783 and served in Annapolis until Congress left for Trenton in June 1784. He had served a total of three years.
When the vote for ratification of the constitution was taking place in Virginia, Monroe criticized the absence of a bill of rights and was worried about surrendering taxation powers to the central government. Virginia narrowly ratified the Constitution. Monroe ran for a House seat in the First Congress but was defeated by James Madison. In 1790 he was elected by the Virginia legislature as United States Senator. He soon joined the "Democratic-Republican" faction led by Jefferson and Madison, and by 1791 he was the party leader in the Senate.
In 1794 George Washington appointed Monroe to the post of Minister (Ambassador) to France in 1794. As ambassador, Monroe secured the release of Thomas Paine in revolutionary France after his arrest for opposition to the execution of Louis XVI. The government insisted that Paine be deported to the United States. Monroe worked to achieve the freedom of all the Americans held in French prisons. He was also able to gain the freedom of Adrienne de La Fayette and issued her and her family American passports. Monroe tried to convince France that Washington's policy of strict neutrality did not favor Britain. But Monroe was unhappy about the signing of the Jay Treaty in London. France and Britain were at war, at the time and the Jay Treaty angered the French. Monroe sympathized with the French, and because of this, Washington discharged him as Minister to France.
Monroe returned home and began practicing law in Virginia. He was elected governor as a Democratic-Republican, and served five terms commencing in 1799. When Jefferson became President he sent Monroe to France to assist in negotiating the Louisiana Purchase. Monroe was then appointed Minister to the Court of St. James's in London from 1803 to 1807. In 1806 he negotiated a treaty with Great Britain, known as the Monroe-Pinkney Treaty which extended the Jay Treaty of 1794. Jefferson was against the Jay Treaty initially, but the treaty had produced ten years of peace and highly lucrative trade for American merchants. When Monroe and the British signed a renewal in December 1806, Jefferson decided not to submit it to the Senate for ratification. Although the new treaty called for ten more years of trade between the United States and the British Empire, Jefferson was unhappy that it did not end the hated British practice of impressment of American sailors. Jefferson did not attempt to obtain another treaty, and as a result, the two nations drifted from peace toward the War of 1812.
Monroe returned to the Virginia House of Delegates and was elected to another term as governor in 1811, but only served four months. He became Secretary of State in April of that year in the Madison administration. He had little to do with bringing about the War of 1812, as President Madison and the War Hawks in Congress were dominant. The war went very badly, and when the British burned the U.S. Capitol and the White House on August 24, 1814, Madison John Armstrong as Secretary of War and turned to Monroe for help, appointing him Secretary of War on September 27. Monroe resigned as Secretary of State on October 1, but no successor was ever appointed and thus from October 1, 1814 to February 28, 1815, Monroe effectively ran both Cabinet posts. A peace treaty was ratified in February 1815, and Monroe therefore resigned as Secretary of War on March 15, 1815 and was formally reappointed Secretary of State. Monroe stayed on at State until March 4, 1817, when he began his term as the new President.
In the election year of 1816, a number of anti-Virginia Republicans objected to the caucus system. But they could not agree on a candidate. Monroe received the nomination. With the Federalist Party in disarray due to the unpopularity of their opposition to the War of 1812, Monroe easily won election. The Federalists did not even name a candidate, though Rufus King of New York did run in opposition to Monroe under the Federalist banner. King carried Connecticut, Delaware, and Massachusetts and won only 34 of 217 electoral votes cast.
The collapse of the Federalists left Monroe with no organized opposition at the end of his first term, and he ran for reelection unopposed, the only president other than Washington to do so. As president, he purchased Florida from Spain and sought to ease partisan tensions, embarking on a tour of the country that was generally well received. As nationalism surged, partisan fury subsided and the "Era of Good Feelings" ensued until the Panic of 1819 struck and dispute over the admission of Missouri embroiled the country in 1820. Nonetheless, Monroe won near-unanimous reelection. In 1823, he announced the United States' opposition to any European intervention in the recently independent countries of the Americas with the Monroe Doctrine, which became a landmark in American foreign policy. His presidency concluded the first period of American presidential history before the beginning of Jacksonian democracy and the Second Party System era.