After the constitution had been drafted, Madison became one of the leaders in the movement to ratify it. His collaboration with Alexander Hamilton and John Jay produced the Federalist Papers (1788). Circulated only in New York at the time, they would later be considered among the most important treatises in support of the Constitution. He was also a delegate to the Virginia constitutional ratifying convention, and was instrumental to the successful ratification effort in Virginia. Like most of his contemporaries, Madison changed his political views during his life. During the drafting and ratification of the constitution, he favored a strong national government, though later he grew to favor stronger state governments, before settling between the two extremes late in his life.
In 1789, Madison became a leader in the new House of Representatives, drafting many basic laws. He is notable for drafting the first ten amendments to the Constitution, and thus is known as the "Father of the Bill of Rights". Madison worked closely with President George Washington to organize the new federal government. Breaking with Hamilton and what became the Federalist Party in 1791, Madison and Thomas Jefferson organized what they called the Republican Party (later called by historians the Democratic-Republican Party).
As Jefferson's Secretary of State (1801-1809), Madison supervised the Louisiana Purchase, which doubled the nation's size. After his election to the presidency, he presided over renewed prosperity for several years. As president (1809-17), after the failure of diplomatic protests and a trade embargo against Great Britain, he led the nation into the War of 1812. He was responding to British encroachments on American honor and rights; in addition, he wanted to end the influence of the British among their Indian allies, whose resistance blocked United States settlement in the Midwest around the Great Lakes. Madison found the war to be an administrative nightmare, as the United States had neither a strong army nor financial system; as a result, he afterward supported a stronger national government and a strong military, as well as the national bank, which he had long opposed. Like other Virginia statesmen in the slave society, he was a slaveholder who inherited his plantation known as Montpelier, and owned hundreds of slaves during his lifetime to cultivate tobacco and other crops. Madison supported the Three-Fifths Compromise that allowed three-fifths of the enumerated population of slaves to be counted for representation.