The town developed during the age of the Muslim emirate of Sicily, when it was known as Qal`at(a)fīmī ( قلعة فيمي ), referring to the defensive castle overlooking the town, now partially restored from ruins.
It was on a hill near Calatafimi, called Pianto Romano, that, in 1860, Giuseppe Garibaldi and his Mille first encountered the troops of the Bourbons on a battlefield (see the Battle of Calatafimi).