The short sword the Greeks used after their spears shattered was the xiphos.
The xiphos was a compact, usually double-edged Greek sword carried as a secondary weapon by hoplites. It was intended for close fighting when a spear was broken, lost, or impossible to use in crowded combat.
Herodotus records that at Thermopylae the Greeks fought with their spears until the weapons were shattered, then switched to short swords. The account describes the final struggle around Leonidas and the remaining defenders during the battle’s last phase.
The xiphos is often confused with the kopis, another Greek sword that had a curved, single-edged blade. The gladius was the characteristic short sword of Roman soldiers, while the sica was a different curved blade associated especially with Thracian and later gladiatorial traditions.