After the year 1000, however, Camerino turned itself into an independent commune. Initially Ghibelline, it later became a Guelph stronghold and suffered much under Emperor Frederick II on account of its loyalty to the pope; Manfred of Sicily's troops, led by Percivalle Doria, besieged and destroyed it (1256): much of the population was killed, but Camerino recovered under Gentile Da Varano, who was amongst the refugees that returned in 1262. Gentile formed a lasting fiefdom for his family which lasted three centuries.