The power of Gelon, tyrant of Syracuse, was expanding rapidly in the first decades of the fifth century. When his ally Theron of Acragas captured Himera, the Carthaginian government, which controled the western part of Sicily, decided to intervene and restore Himera to its tyrant Terillus. The Carthaginian commander Hamilcar built up a large army and navy in the far west of Sicily and started to besiege Himera. Theron, however, held out, and in Syracuse, Gelon mobilized.
It seems that the Carthaginians expected reinforcements from their Greek allies from Selinus, and understood too late that the troops they had allowed to enter in their camp, were in fact their enemies. This is, at least, how Diodorus of Sicily tells the story in his World History (more). Herodotus of Halicarnassus tells the story too, but focuses on the fighting in the camp (more).
After the victory, which meant the beginning of a Syracusan superiority on Sicily that was to last for some seven decades, the Greeks built a temple to commemorate the spectacular achievement. The foundations can still be seen on the spot, but the decoration is now in the Museo Archeologico Regionale "Antonio Salinas" in Palermo.
Other monuments erected to commemorate the Greek victory were the Temple of Athena in Syracuse, which is still in use as cathedral, the temple of Hera in Acragas, and at a temple in Selinus.
According to later legend, the victory at Himera, where the western Greeks had been liberated from the Carthaginian threat, took place on the very day of the Greek defeat at Thermopylae or Salamis.