In 1797, during the French Revolutionary Wars, the Papal States signed the Treaty of Tolentino, paying a substantial armistice fee and ceding territory to the invading French. In 1798 Rome was taken by French troops, who established the Roman Republic, a satellite state of the French Republic. After the Battle of Marengo in 1800, General Napoleon Bonaparte, commander of the French Revolutionary Army, began the annexation of much of northern Italy but restored the Roman Republic to the papacy. The French made Italy a client state of the French Empire and renamed it the new kingdom of Italy. The relationship between the papacy and France remained cordial until 1809 when Napoleon again invaded the Papal States. He imprisoned Pius VII until 1814 and annexed the remaining church states. The Papal States were restored with the fall of the Napoleonic system in 1814. In 1860–61 a unified Italy overthrew the Bourbon and Habsburg dynasties and annexed the Papal States.
— OR —