It is home to a large fortress (Fortilizio), designed, among the others, by Francesco di Giorgio Martini Originally, the town belonged to the Church.
Eventually, Cardinal Egidio Albornoz brought the territory back under the control of the Papal States.
The following period saw Sant'Agata Feltria under the authority of the rector of Massa Trabaria and then the Malatesta family, who held it from 1420 to 1463.
Federico da Montefeltro, Duke of Urbino, solidified this link by marrying his daughter Gentile to Agostino Fregoso, son of the Genoese Doge Lodovico di Campofregoso, in 1470.
The Rocca Fregoso, a prominent fortress that is the symbol of the town, was commissioned in this period by Federico da Montefeltro.