Thomas Jefferson drafted the Virginia Statute for Religious Freedom in 1777. After years of debate, the Virginia General Assembly enacted it on January 16, 1786.
James Madison, Jefferson's protégé, shepherded the statute through the legislature. Later, as a Congressman, Madison used its language and logic to frame the First Amendment's Establishment and Free Exercise Clauses ("Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof").
While Madison was the legislative strategist, the statute's philosophical core—natural rights, separation of church and state, freedom of conscience—is quintessentially Jeffersonian. He considered it one of his three greatest achievements (with the Declaration of Independence and founding UVA), requesting it on his epitaph.