After its defeat at the Siege of Yorktown in 1781, Britain signed a peace treaty. American sovereignty became internationally recognized, and the country was granted all lands east of the Mississippi River. Tensions with Britain remained, however, leading to the War of 1812, which was fought to a draw. Nationalists led the Philadelphia Convention of 1787 in writing the United States Constitution, ratified in state conventions in 1788. The federal government was reorganized into three branches in 1789, on the principle of creating salutary checks and balances. George Washington, who had led the Continental Army to victory, was the first president elected under the new constitution. The Bill of Rights, forbidding federal restriction of personal freedoms and guaranteeing a range of legal protections, was adopted in 1791.