The fourth president of the United States was James Madison, who was elected in 1808. The War of 1812 was fought during his time in office, and he served two terms, leaving office in 1817.
Madison was born in 1751 and played a key role in the formation of the United States. He helped create Virginia's state constitution, ratify the United States Constitution and draft the Bill of Rights. Before becoming president, Madison held roles in the Virginia Assembly, the Continental Congress and President Jefferson's Cabinet as the Secretary of State. In 1836, he died at his estate in Virginia.