Parma, like most northern Italian cities, was nominally a part of the Holy Roman Empire but locally ruled by its bishops until the commune gained strength in the early Middle Ages. It fell under the control of Milan in 1346, was ceded to the Holy See in 1511. The Farnese pope, Paul III, detached Parma and Piacenza from the Papal States and gave them as a duchy for his illegitimate son, Pier Luigi Farnese, whose descendents ruled in Parma from 1545 to 1731, when Antonio Farnese (1679-1731), last male of the Farnese line, died.
The combined Duchy of Parma and Piacenza was given to the House of Bourbon in a diplomatic shuffle of the European dynastic politics that were played out in Italy. It remained separate until the unification of Italy in 1860.