The French Revolution began in 1789 with the storming of the Bastille prison. King Louis XVI was guillotined during this period. A republic was established in France from 1789-1799. Napoleon crowned himself Emperor in 1804. The Treaty of Fontainebleau allowed Napoleon to invade Spain in 1807. This began the Spanish Independence War against French rule that lasted from 1808-1814.