While Jefferson as President was solving national problems, his home state was solving problems, too. In August 1800, Virginia had its first organized slave insurrection. Led by Gabriel, approximately one thousand slaves in the area around Richmond decided to march on Richmond and massacre the white inhabitants there. However, at the scheduled time for the march to begin, a severe rainstorm delayed the march. During the delay, Pharaoh, one of the Negroes, decided to warn the Richmonders of their impending disaster. In spite of the heavy rains and the fact that it became necessary for him to swim certain swollen streams without being caught by one of his own group, he continued to Richmond and warned the authorities in time. He informed them of the proposed plan to kill the male inhabitants, capture the women inhabitants, seize the public arms and create a general slave insurrection. Consequently, the conspirators, including Gabriel, were caught, convicted and executed. The Virginia Assembly rewarded Pharaoh for his courageous act by giving him complete freedom.

While the State of Virginia was increasing its counties, the United States was beginning to expand beyond its original boundary established after the Revolutionary War. President Jefferson had heard rumors that Spain had ceded Louisiana back to France in secret diplomatic relations. If true, such a condition could ruin American trade along the Mississippi River and could suggest a possibility of a French empire in America. Jefferson decided to have the government of the United States purchase the Island of Orleans, near the mouth of the Mississippi River. After the United States Ambassador to France had been unable to purchase only the Island of Orleans, Jefferson sent James Monroe, a native of Westmoreland County, to assist the Ambassador. In 1803, the treaty making the purchase of Louisiana, that vast area of land west of the Mississippi, official was ratified by the United States. This purchase added 827,000 square miles to the area of the land under the jurisdiction of the United States government at the cost of $15,000,000.

President Jefferson was also very much interested in the Oregon Country. He had made frequent attempts to have this region explored but all his attempts were unsuccessful. However, after the purchase of Louisiana, he persuaded the federal government to finance, by means of a $2500 appropriation, an official government expedition to make the first overland route to the Pacific Ocean and to explore the region which the United States had recently acquired. He selected Captain Meriwether Lewis of Ivy, Virginia, to head this expedition and Lieutenant William Clark, a very close Virginian friend of Lewis' to accompany him. Their group left St. Louis in the spring of 1804, traveled up the Missouri River, spent a rigid winter in an area now located in North Dakota, continued traveling up the Missouri in the spring of 1805, crossed the Rocky Mountains, and built and paddled canoes until they reached the mouth of the Columbia River in November, 1805. There they built a fort near the present site of Astoria. They remained on the Pacific Coast during the winter and returned to St. Louis in 1806. Lewis and Clark were aided considerably in their travel route directions by an Indian woman guide, Sacajawea. This expedition to the Northwest furnished the best claim of the United States in later ownership disputes with England.

Aaron Burr, long the political opponent of Alexander Hamilton, lived in Petersburg. In 1807, Burr was accused of a conspiracy to invade Mexico, to snatch it from Spanish control and to establish an independent Mexican government with himself as the self-appointed ruler. Furthermore, he was accused of having laid plans for setting up a government in the western territory of the United States with the objective of eventually organizing this area into a separate, independent government with himself the self-appointed ruler. Burr was officially tried on a charge of treason at the State Capitol Building in Richmond. Chief Justice John Marshall was the presiding judge. Jefferson, who had disliked Burr for political reasons for a long time and who believed that Burr was guilty of the aforementioned treasonous actions, wanted Burr convicted. Although the trial involved many political entanglements, Burr was finally acquitted.

During the same year, Virginia made national headlines again when the "Leopard-Chesapeake" Affair took place. France and Britain had been having personnel problems with their navy crews, each accusing the other of trying to encourage desertions. Britain had sent a fleet over to Norfolk in an attempt to intercept some French ships harbored in the Chesapeake Bay. One of the British ships had its entire crew desert, and it was believed that they had dashed to Norfolk and would be hiring out soon on a French or American ship. The British captain of the fleet had been informed that these crew members supposedly had enlisted on the "Chesapeake," a new American naval vessel. A British vessel, the "Leopard," was ordered to search the "Chesapeake" outside the jurisdiction of the United States. Consequently, the "Leopard" followed the "Chesapeake" out beyond Cape Henry and then demanded that the "Chesapeake" be searched by British officers. When the "Chesapeake," under the command of Commodore James Barron, denied having any deserters and refused the right to search, the "Leopard" approached very closely the "Chesapeake" and fired at it broadside. Three Americans were killed, seventeen others wounded and four deserters were surprisingly found aboard the "Chesapeake." Although many Americans clamored for war as a result of this incident, Jefferson, who still preferred peace, retaliated by having Congress pass the Embargo Act whereby no American ship could depart for any foreign port. Jefferson believed the lack of American exports would cause the countries of Europe to cease the practice of impressment of American seamen. The Americans, however, suffered more from this act than did the French and the British; eventually, it was repealed and a law was passed allowing American vessels to trade with any country except England and France. By the end of Jefferson's administration, nevertheless, the American people were very restless, and in some sections of the country war was believed to be inevitable with England or with France.

On March 4, 1809, Virginia had another one of her sons, James Madison, inaugurated as President of the United States. He was born in Port Conway, Virginia, and, after graduating from Princeton, he had fought in the Revolutionary War. He had served in the state legislature, had been a member of the Second Continental Congress, had been a member of the Constitutional Convention in Philadelphia where he had earned the title "Father of the Constitution of the United States" and had contributed to the "Federalist" papers encouraging the adoption of the Constitution. After serving in the United States House of Representatives, he had retired from national politics and had centered his interest upon state government functions. He had written the "Virginia Resolutions" and had served as United States Secretary of State at the request of President Jefferson. Therefore, he came to the Presidency well prepared to assume presidential duties.

In contrast with his desire for peace, Madison held the office of President of the United States during the War of 1812 with England. Only a few battles were fought near Virginia in this war. The British had as one of their objectives the capture of the City of Norfolk. George Cockburn, a British Admiral, entered Chesapeake Bay with a fleet of approximately 1800 men, and they plundered many plantations along the coast of Maryland and Virginia. An American ship, the "U. S. S. Dolphin," was captured by the British ship, "St. Domingo," in the Rappahannock River. A sea battle was later fought at Craney Island, located at the entrance of Norfolk Harbor where American sailors, marines and militia men were defending the small island. As the British rowed toward the island shore on barges, heavy artillery fire sank many of the boats causing hundreds of the Britishers to drown. The British subsequently withdrew and Norfolk escaped serious damage. The British soon desired to attack Hampton. They successfully pillaged the town and proceeded to the Carolinas. Several Virginians participated in the War of 1812 and the students of Hampden-Sydney College, as in the Revolutionary War, volunteered as an entire student body to fight for their country.

Virginia became a famous place of refuge during the War of 1812. When the British invaded Washington in August 1814, President Madison and his wife, Dolly Madison, fled from the White House on August 24 to Salona, a house located in Falls Church. It is believed that Dolly Madison crossed the Chain Bridge over the Potomac River and traveled rapidly over the secondary roads until she finally reached the house of Reverend and Mrs. William Maffitt. Dolly Madison carried with her the Declaration of Independence and the famous portrait of George Washington painted by Gilbert Stuart. Mrs. Maffitt quickly admitted Dolly Madison, and the President himself and some of his cabinet members arrived later with Reverend Maffitt. They could see the burning White House from the Maffitt residence. Although the President had to depart shortly afterwards, Dolly Madison stayed there for the duration of the war.

After his Presidency had ended, James Madison returned to Montpelier, the family homestead near Orange, where he lived until his death in 1836.