Persano broke off the engagement, and though his ships still outnumbered the Austrians, Persano refused to counter-attack with his badly demoralized forces. The Italian fleet began to withdraw, followed by the Austrians; as night began to fall, the opposing fleets disengaged completely, heading for Ancona and Pola, respectively. "Castelfidardo" had emerged from the battle relatively unscathed, though the captain's cabin had been set on fire by an Austrian shell. After the battle, Vacca replaced Persano; he was ordered to attack the main Austrian naval base at Pola, but the war ended before the operation could be carried out. For the rest of her long career, "Castelfidardo" served in a variety of roles, both in the main fleet and in Italy's colonial empire. After the end of the war, the government lost confidence in the fleet and drastically reduced the naval budget. The cuts were so severe that the fleet had great difficulty in mobilizing its ironclad squadron to attack the port of Civitavecchia in September 1870, as part of the wars of Italian unification. Instead, the ships were laid up and the sailors conscripted to man them were sent home. Some time after 1866, the ship was rebuilt as a central battery ship, with most of her guns located in a central, armored casemate. Two other guns were placed in the bow as chase guns, with a third mounted as a stern chaser. Around 1871, her armament was also revised, to two guns in the bow and eight 8 in guns, four on each broadside. By 1880, her armament had been changed another time, with two guns replacing the 10 in guns, and a ninth 8 in gun being added in the stern. The ship was modernized in 1884, with her armament replaced with eight guns, six guns, four quick firing (QF) guns, and eight Hotchkiss revolver cannons. For the annual fleet maneuvers held in 1885, "Castelfidardo" served in the "Eastern Squadron", joined by the ironclad , the corvette , a sloop, and four torpedo boats. The "Eastern Squadron" defended against an attacking "Western Squadron", simulating a Franco-Italian conflict, with operations conducted off Sardinia. By 1899, "Castelfidardo" had been assigned to the 2nd Division, which also included the ironclads "Affondatore" and and the torpedo cruisers and .