 Pepin the Short gave it to the Holy See, but during the wars of the popes and the Italian cities against the emperors, Rimini sided with the latter.In the 13th century, it suffered from the discords of the Gambacari and Ansidei families.The city became a municipality in the 14th century, and with the arrival of the religious orders, numerous convents and churches were built, providing work for many illustrious artists.