Although the Kingdom of Italy was officially proclaimed on March 17, 1861, the events leading to that can be traced back to 1849, when Venice fell to the Austrian forces after a rebellion was crushed.
It took 9 long years for Napoleon III and Cavour to fight back against Austria. The joint effort redistributed the control over Lombardy, Venetia, Parma and Modena (back to Piedmont) and Savoy and Nice (to France) in 1858.
In 1859 Sardinia stretched towards central and northern Italy culminating in the biggest annexation until that point, with Tuscany, Parma and Modena joining the United Provinces of Central Italy first, and Sardinia next. At that point Italy was getting closer to unification, with only 4 states in existence: the Austrians in Ventia, the Papal State (later known as Vatican), the Kingdom of Piedmont and Sardinia, and the Kingdom of the Two Sicilies.
In February 1860 Victor Emmaniel II became the King of Italy, leading a parliament. On May 6th, that year, Giuseppe Garibaldi left Genoa with the Expedition of One Thousand, a unification movement heading south. A few days later they reached Marsala in Sicily and subsequently he self proclaimed ruler over the island of Sicily. From there Garibaldi led his army back north, annexing first Basilicata, then Naples, where in September he was welcomed as a liberator.
Meanwhile Victor Emmanuel II led the Sardinians into the Papal State from the west, forcing them to meet with Garibaldi from the south. At that point Garibaldi hands over his power to the king, which a few months later, on March 17, 1861, proclaims the Kingdom of Italy.
Camillo Benso di Cavour died in June 1861, having seen his hard work paying back, with only Venetia and Papal State being not yet annexed to a unified Italy.
While diplomacy was at work in the Papal State, Victor Emmanuel II met with Napoleon III in 1864 to discuss a gradual withdrawal of French troops from the Papal State within 2 years.
In 1865 the capital city was moved from Turin to Florence. Throughout the second half of 1866, Italy continued war against the weakened Austro-Prussians for the liberation of Venetia. Eventually the Austro-Prussian signed the armistice to keep France out of the war and cede Venetia to France, which promptly handed it over to Italy.
In September 1870 negotiations failed to peacefully hand Rome to Italy. An Italian army then entered Rome and after a plebiscite, Rome was annexed by the Kingdom of Italy, completing the unification. In June 1871 the capital city was officially moved from Florence to Rome.