During the American Revolution, Jefferson represented Virginia in the Continental Congress that adopted the Declaration of Independence. As a Virginia legislator, he drafted a state law for religious freedom. He served as the second Governor of Virginia from 1779 to 1781, during the American Revolutionary War. In 1785, Jefferson was appointed the United States Minister to France, and subsequently, the nation's first Secretary of State under President George Washington from 1790 to 1793. Jefferson and James Madison organized the Democratic-Republican Party to oppose the Federalist Party during the formation of the First Party System. With Madison, he anonymously wrote the provocative Kentucky and Virginia Resolutions in 1798 and 1799, which sought to strengthen states' rights by nullifying the federal Alien and Sedition Acts.