Hundreds of chartered buses brought protesters in from around the country to the Greek capital, while more people arrived on ferries from the islands. Traffic was blocked throughout the city center and three major subway stops were closed.
Chanting "Hands off Macedonia!" and "Macedonia belongs to Greece!" the protesters converged on Syntagma Square in front of parliament, many waving flags bearing the Star of Vergina, the emblem of the ancient Greek kingdom of Macedonia.
Police officials estimated the attendance at 140,000. Organizers, who claimed 1.5 million were at the rally, used a crane to raise a massive Greek flag over the square.
"We are trying to show the politicians ... that they must not give up the name 'Macedonia'," said 55-year-old protester Manos Georgiou.
In Skopje, a spokesman for the Macedonian government said he didn't know whether his government would react to the rally. Macedonian opposition leader Hristijan Mickoski said in a TV interview that the rally hurt the prospects of a deal on the name issue.
Greek Prime Minister Alexis Tsipras was dismissive of the event.
"The overwhelming majority of the Greek people...irrespective of their opinions (on the issue) agree that major foreign policy issues cannot be solved through fanaticism and intolerance," he said in a statement.
Tsipras used the occasion to attack Greek opposition leader Kyriakos Mitsotakis and his fellow conservative, former Greek Prime Minister Antonis Samaras, for allegedly trying to use Sunday's rally for their advantage and to paper over their own differing approaches.
About 700 left-wing and anarchist protesters set up a counter-demonstration nearby, bearing banners calling for Balkan unity. "Macedonia belongs to its bears" read one banner.
Dozens of riot police were deployed to keep the two demonstrations separate.
Suspected far-right supporters attempted to attack the counter-demonstration, but were prevented by police who used stun grenades and tear gas to hold them back. The far-right side responded by throwing rocks at police.
There were also reports alleging that anarchists attacked a biker carrying a Greek flag and a person wearing a T-shirt commemorating the participation of Greek mercenaries in the massacres of Muslim civilians in Bosnia during the 1990s.
The name dispute broke out after Macedonia gained independence from Yugoslavia in 1991.
The country is recognized by international institutions as the Former Yugoslav Republic of Macedonia, even though about 130 countries refer to it simply as Macedonia. Many Greeks refer to it by the name of its capital, Skopje.
Greece argues use of the name implies territorial claims on its own province of Macedonia, home of one of the most famous ancient Greeks, Alexander the Great.
Officials in Skopje counter that their country has been known as Macedonia for a long time.
Composer and former minister Mikis Theodorakis, 92, the keynote speaker at the rally, repeated the controversial claim that Greece's neighbor wants to expand into Greek territory.
"Using the name Macedonia as a vehicle and twisting historical events to a ridiculous extent, they actually seek to expand their borders at the expense of ours," Theodorakis said.
Rejecting any compromise on Greece's part, Theodorakis called for a referendum on the issue.
The squabble has prevented Macedonia from joining NATO, to which Greece already belongs. The left-led governments in both countries have pledged to seek a solution this year, and have been holding talks with U.N. negotiator Matthew Nimetz.
The most likely solution will be to add a modifier such as "new" or "north" to the republic's name. But the proposals have triggered protests in both countries.
The crowd at Sunday's rally in Athens jeered when speakers mentioned Nimetz's name.
"We're expecting them to hear us," protester Maria Iosifidou said of Greece's politicians. "We don't want Skopje to take the name ...let them have another name."
About 100,000 people attended a similar protest last month in the northern Greek city of Thessaloniki, the capital of Greece's province of Macedonia.
Raphael Kominis and Demetris Nellas in Athens and Konstantin Testorides, in Skopje, contributed to this report.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.