The immediate cause of the war was the candidacy of the German prince Leopold of Hohenzollern-Sigmaringen for the Spanish throne, which had been vacant since the revolution of September 1868. Asked by the French to guarantee for Leopold's permanent withdrawal also in the future, King William of Prussia declared the matter outside his control. His telegram (the Ems Dispatch) reporting this interview with the French ambassador was edited by chancellor Bismarck of Prussia in such a way as to provoke French indignation. France officially declared war on July 19, 1870.
Against French expectations, the south German states, independent from Prussia but connected to it by secret treaties, joined the war.
The French were soundly defeated in several battles owing to the military superiority of the Prussia forces and their commanders. At Sedan on September 2, the French emperor Napoleon III was taken prisoner with 100,000 of his soldiers. This led two days later to a bloodless revolution in Paris, ending the Second French Empire, and leading to the creation of a new government of national defence.
A further crushing French loss came at Metz, where Marshal Bazaine surrendered 180,000 soldiers on October 27. An armistice was signed on January 28, 1871, ten days after William's proclamation as German emperor at Versailles.
However, the National Guard and the workers of Paris refused to accept defeat, blaming the conservative government for failing to organise effective national resistance, and seized control of the French capital on March 18, establishing the Paris Commune. With tacit Prussian support, the French army re-conquered Paris and executed tens of thousands of workers and revolutionaries in the "Bloody Week" (May 21-28).
The preliminary Franco-German peace signed at Versailles (February 26) was confirmed by the Treaty of Frankfurt (May 10, 1871). France was obliged to cede three eastern départements (until 1919 the Prussian province of Alsace-Lorraine) and to pay a war indemnity of 2000 million francs. German troops remained in parts of France until the last instalment of the indemnity was paid off in September 1873.
While the war united Germany under the Prussian crown, France became a republic (February 1875) in which memories of the Commune continued to divide left and right. Also as a result of the war, the Papal States, no longer under French protection, were seized (September 20, 1870) by Italy, completing the unification of that country.
The war embittered Franco-German relations for decades to come, contributing to the European rivalries which would erupt in World War I. French agitation for revanche - revenge for the loss of Alsace-Lorraine - gave its name to the phenomenon of revanchism, the desire to punish a past enemy and regain former territories.