Italy is a country; however, it wasn't always a unified country. For hundreds of years, Italy was split into different city-states, kingdoms and principalities. It was also ruled by various foreign powers.
During the Congress of Vienna of 1815, Austria, Great Britain, Prussia and Russia divided Italy among themselves. The House of Savoy ruled Piedmont and Sardinia. In the south, Sicily and Naples were placed under the control of the French Bourbons. The Papal states were given to the Pope, and Austria ruled Lombardy and Venetia.
The subjects of these powers rebelled, and in 1861 the Kingdom of Italy was established under Victor Emmanuel II. By 1871, Italy was established as a united country with Rome as its capital.