Police fired tear gas at some of those attending a protest which attracted tens of thousands to the city.
The deal, which is yet to be approved, designates Greece’s northern neighbour as Republic of North Macedonia.
The name Macedonia is sensitive for many Greeks who say it implies a claim on the Greek province of the same name.
Years of wrangling finally brought an agreement last June between Greece’s left-wing Prime Minister Alexis Tsipras and his Macedonian counterpart.
A vote on the deal, which aims to end a 28-year row between the nations, is set to take place in the Greek parliament this week.
The dispute dates back to 1991 and the break-up of Yugoslavia. Macedonia was a Yugoslav republic and adopted the name Macedonia when it became an independent nation.
Greece has long argued the use of the name implied a territorial claim and cultural appropriation. At the UN the country was formally known as the Former Yugoslav Republic of Macedonia (Fyrom).
Greek opposition figures argue Mr Tsipras has made too many concessions.
Last week he narrowly survived a vote of no confidence after his junior coalition partner withdrew support.
Some members of the Greek parliament have received death threats intended to influence their vote.
What happened on Sunday?
Organisers had said as many as 600,000 people were expected to take part in Sunday’s demonstrations.
The actual numbers fell far short – with police estimating 60,000 in the capital at 14:00 local time (12:00 GMT).
People had travelled from across the country to demonstrate close to the national parliament.
Demonstrators in the capital on Sunday chanted, “Macedonia is Greek” and waved Greek flags.
A number of clerics, dressed in black, were among those taking part.
“We cannot stomach this deal, to give away our Macedonia, our history,” a 67-year-old protester at the scene, Amalia Savrami, told Reuters.
At one point, scuffles broke out near parliament when masked demonstrators threw stones and fireworks at police.
Police blocked gas-mask-wearing protesters from storming steps leading to parliament.
A highway was also temporarily blocked in northern Greece in solidarity with the protesters, reports say.
Why is the name change controversial?
Greek nationalists argue that the name Macedonia can only refer to the Greek province of the same name.
The dispute has led to Greece to blocking Macedonia’s hopes of joining Nato and the European Union.
Under the deal, the country’s language would be Macedonian and its people known as Macedonians (citizens of the Republic of North Macedonia).
The move has met with sharp resistance in both countries because nationalists believe it erodes their identity.