The Greek vote comes two weeks after Macedonia’s parliament also narrowly approved the accord.
Nationalists on both sides are fiercely opposed to it, with Macedonian critics saying the name change waters down the country’s identity and represents a humiliating capitulation.
Greek concerns that their ancient heritage was being appropriated were amplified when a former government in Macedonia went on an extravagant building spree in Skopje, the capital, erecting giant gilded statues of Alexander the Great, his father Philip II of Macedon and dozens of other historic figures.
Zoran Zaev, Macedonia’s prime minister, congratulated Mr Tsipras immediately after the accord was approved in Athens.
“Together with our peoples we reached a historic victory,” he wrote on Twitter.
Donald Tusk, the president of the European Council, wrote: “Mission impossible accomplished.”
Jeremy Hunt, the Foreign Secretary, also welcomed the agreement. “Both countries have demonstrated great courage and the will to work together to affect real change,” he said.
The Macedonians will now have to add explanatory plaques to their statues and monuments in Skopje and will be required to remove all public imagery of the Sun of Vergina, an ancient symbol associated with Alexander’s family.