In the wake of the French Revolution, Switzerland fell to a French invasion in 1798 and was reformed into the Helvetic Republic, a French client state. Napoleon's "Act of Mediation" in 1803 restored the status of Switzerland as a Confederation, and after the end of the Napoleonic period, the Swiss Confederation underwent a period of turmoil culminating in a brief civil war in 1847 and the creation of a federal constitution in 1848.