James Madison, Jr. (March 16, 1751 – June 28, 1836) was an American politician, the fourth President of the United States (1809–1817), and one of the Founding Fathers of the United States. Considered to be the "Father of the Constitution", he was the principal author of the document. In 1788, he wrote over a third of the Federalist Papers, still the most influential commentary on the Constitution. The first President to have served in the United States Congress, he was a leader in the 1st United States Congress, drafted many basic laws and was responsible for the first ten amendments to the Constitution (said to be based on the Virginia Declaration of Rights), and thus is also known as the "Father of the Bill of Rights". As a political theorist, Madison's most distinctive belief was that the new republic needed checks and balances to limit the powers of special interests, which Madison called factions. He believed very strongly that the new nation should fight against aristocracy and corruption and was deeply committed to creating mechanisms that would ensure republicanism in the United States.
As leader in the House of Representatives, Madison worked closely with President George Washington to organize the new federal government. Breaking with Treasury Secretary Alexander Hamilton in 1791, Madison and Thomas Jefferson organized what they called the Republican Party (later called the Democratic–Republican Party) in opposition to key policies of the Federalists, especially the national bank and the Jay Treaty. He secretly co-authored, along with Thomas Jefferson, the Kentucky and Virginia Resolutions in 1798 to protest the Alien and Sedition Acts.
As Jefferson's Secretary of State (1801–1809), Madison supervised the Louisiana Purchase, doubling the nation's size, and sponsored the ill-fated Embargo Act of 1807. As president, he led the nation into the War of 1812 against Great Britain in order to protect the United States' economic rights. That conflict began poorly as Americans suffered defeat after defeat by smaller forces, but ended on a high note in 1815, with the Treaty of Ghent, after which a new Era of Good Feelings swept the country. During and after the war, Madison reversed many of his positions. By 1815, he supported the creation of the second National Bank, a strong military, and a high tariff to protect the new factories opened during the war.