 The it was under the da Varano, Malatesta, Sforza and Visconti.In 1440, under Francesco Sforza, a new line of walls was built (called "Scarpata", or "Escarpment"), while a fortress was built to protect the port (the current communal palace "Cesarini-Sforza" was built on its remains).The city, attacked by Turk pirates, riven by internal feuds and by the plague, started to decay from the 16th century.