Before 1870, the country of Italy did not exist as a unified political entity. Instead, the Italian peninsula was a patchwork of city-states, many of which had existed since the fall of the Western Roman Empire. Nevertheless, a quiet Italian nationalism which had simmered since medieval times started to catch fire in the early 1800s. The political movement known as Young Italy became an important stepping stone towards the unification of Italy.
The concept of a "whole Italian people" goes at least as far back as Petrarch, whom Machiavelli quoted when he exhorted his patron to "liberate Italy from the barbarians." As Machiavelli saw it, the city-states of the Italian peninsual were:
"more a slave than the Hebrew, more oppressed than the Persian, more disunited than the Athenian, without a head, without order, beaten, spoiled, torn in pieces, over-run and abandoned to destruction in every shape."
As a whole, the Italian city-states escaped the fate of the Balkans because they managed to stay clear of proxy fights involving the Ottoman Empire. This was established after the 1481 Battle of Otranto, in the southern Italian Kingdom of Naples, which conclusively ended Muslim occupation of any Italian territory.
However, as Machiavelli had foreseen, the northern Italian peninsula became the battleground for proxy fights between France and Spain. Later, Spain's role was taken over by the Holy Roman Empire, which later became the Austro-Hungarian Empire. At the same time, the southern part of the Italian peninsula, which was mostly agricultural, was mostly cut off from the events of the north.
The Napoleonic Wars disrupted this state of affairs. After his conquest of Italy, Napoleon set up satellite states under the Napoleonic Empire in both North and South Italy. In fact, Napoleon set his own brother-in-law Joachim Murat as the new king in the Kingdom of Naples, which had previously seen the short-lived Parthenopean Republic sprout under French revolutionary principles.
Both of these satellite governments fell with Napoleon. However, before they collapsed, their local rulers tried to muster popular support by appealing to nationalist principles. Even after the Congress of Vienna tried to restore things as they had been, those strengthened nationalist ideas never went away.
After 1815, nationalist ideals grew into the secret revolutionary societies known as the Carbonari. Their uprisings were generally unsuccessful and they were finally defeated in 1831, with much of their leadership in exile, imprisoned, or executed.
Giuseppe Mazzini was among those who was arrested. When he was released later in 1831, he left the Italian peninsula for French Marseilles, close to his native Piedmont. There, he immediately founded the new movement known as Young Italy.
Like the Carbonari, the purpose of Young Italy was to free Italy from all foreign powers and create a united Italian republic. Unlike the Carbonari, Young Italy was primarily political, while still drawing on the strong moral base which had been planted by the French Revolution 40 years earlier.
This difference brought Young Italy partly out of the shadows to become a popular movement. By 1833, Young Italy claimed to have 60,000 members. However, Young Italy was still primarily a conspiratorial movement whose goal was general insurrection against the Austrian Empire.
As a result, many members of Young Italy were arrested for conspiracy to incite revolution during the 1830s. By 1834, the movement had gone back underground, only to reappear in England in 1838.
In 1848, Young Italy had its greatest moment of success, with the establishment of the Roman Republic. Predictably, it was also short-lived. Pope Pius IX called in the French army to re-establish the Papal States, and the Roman Republic was gone by 1849.
Many further attempts to rebel were all unsuccessful. Young Italy was finally crushed in 1853.
Once again, a phoenix arose from the ashes. Giuseppe Garibaldi, a former member of Young Italy, went on to become the unifier of Italy. With Garibaldi's help, Victor Emmanuel II, the previous King of Naples and heir to the House of Savoy, was crowned the first king of the Kingdom of Italy on March 17, 1861.
The final major holdout, the Papal State, resisted Italian unification to the bitter end. In fact, Pope Pius IX was so determined to keep the Papal State independent that he instructed the Papal volunteers to resist any military incursion, even after French Emperor Napoleon III withdrew his garrison from Rome in July 1870. After a cannonade lasting three hours had breached the Aurelian walls, 49 Italian soldiers and 19 Papal volunteers died before Pius IX finally surrendered on September 20, 1870. In 1871, Rome became the capital city of a united Italy.
Mazzini lived just long enough to see the unification of his beloved Italy, but it was not the Italy he had hoped for. Unified Italy was still a monarchy when he died on March 10, 1872, and it remained a monarchy for three more monarchs after Victor Emmanuel II. It would not become the republic for which Mazzini had hoped until half a century later, with the referendum of June 2-3, 1946.