Its principal church, S. Flaviano, was raised to the dignity of a cathedral on 21 December 1239, and separated from the jurisdiction of the diocese of Osimo. The diocese of Osimo was suppressed, having chosen to support the Emperor Frederick II against the pope.[2] On 22 May 1240, the Castello di Recanati was raised to the dignity of a city by Gregory IX.[3]