Central Athens turned into a sea of people holding blue and white Greek flags as thousands came from all over the country to rally against the accord to name the ex-Yugoslav state North Macedonia.
After some 30 masked youths tried to force the closure of the parliament building by throwing stones, riot police responded with tear gas volleys to break up the crowd there, Presstv reported.
Hundreds of buses, especially from northern Greece, had brought protesters in for the rally, on Syntagma square near the parliament.
Police estimates put the number of demonstrators at 60,000 at 1200 GMT, while organizers said 100,000 people had turned out.
The crowd was monitored by almost 2,000 police, equipped with drones and helicopters, a police source said.
Much of the city center was closed to traffic on Sunday and some metro stations closed as a precaution.
Greek clerics dressed in black joined the rally to protest an accord to rename Macedonia the Republic of North Macedonia, an agreement that would end a 27-year dispute with Greece over the country's name.
Many Greeks believe the name Macedonia implies a territorial claim over their country's own northern region of that name.
The issue evokes strong emotions among Greeks who consider Macedonia, the ancient kingdom ruled by Alexander the Great, to be an integral part of their homeland and heritage.
The accord, signed by the two governments, unblocks the ex-Yugoslav republic's desire to join NATO and the European Union once ratified by Greece's parliament.
"We cannot stomach this deal, to give away our Macedonia, our history," said pensioner Amalia Savrami, 67, as she waved a large Greek flag on Athens's Syntagma Square. "Macedonia is Greek, period."
Locals said the Athens rally was the largest in decades, easily outdoing rallies against austerity in previous years.
Macedonia declared independence in 1991, avoiding the violence that accompanied much of the break-up of Yugoslavia.
Prime Minister Zoran Zaev has sought to accelerate the country's bid to join the EU and NATO and to work on resolving the decades-old name dispute with Greece.
Greece had agreed that until the name dispute is resolved, its northern neighbor, with a population of about 2 million, could be referred to internationally as "FYROM" - Former Yugoslav Republic of Macedonia.
That is the name under which it was admitted to the United Nations in 1993.
Settling the issue would be hailed as a success by Greek Prime Minister Alexis Tsipras, whose left-right coalition came to power in 2015.
A wide range of Greek political parties, from the far-right to the socialists oppose the change, but it could nonetheless be approved by the required 151 deputies in the 300-seat parliamentary chamber.
Macedonia's parliament approved a constitutional revision to change the country's name 10 days ago.
But for the deal between the two leaders to go through, the name change also needs to be approved by the Greek parliament.
Tsipras' ruling coalition fell apart over the deal a week ago, but he then narrowly won a vote of confidence, setting the stage for parliament to vote on its ratification.