Napoléon Bonaparte (15 August 1769 – 5 May 1821) was a French military and political leader who rose to prominence during the latter stages of the French Revolution and its associated wars. As Napoleon I, he was Emperor of the French from 1804 to 1814 and again in 1815. Napoleon dominated European affairs for almost two decades while leading France against a series of coalitions in the Revolutionary Wars and the Napoleonic Wars. He won the large majority of his battles and seized control of most of continental Europe before his ultimate defeat in 1815. One of the greatest commanders in history, his campaigns are studied at military schools worldwide and he remains simultaneously one of the most celebrated and controversial political figures in European history. In civil affairs, Napoleon implemented a wide array of liberal reforms across Europe, including the abolition of feudalism, the establishment of legal equality and religious toleration, and the legalization of divorce. His lasting legal achievement, the Napoleonic Code, has been adopted to varying degrees by dozens of nations around the world.