Thousands of protesters have gathered in Syntagma Square in Athens to demonstrate against Greece's agreement with Macedonia to change the latter's name to Republic of North Macedonia.

Hundreds of buses, especially from northern Greece, brought protesters in for the rally that took place on Syntagma square near the parliament.

Police estimates put the number of demonstrators at 60,000 around midday while organisers said 100,000 people turned up.

Some protesters clashed with riot police on the steps up to the parliament building on Sunday, throwing rocks, flares, firebombs, paint and other objects.

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.

John Psaropoulos, reporting for Al Jazeera from the demonstration, said the demonstration was "broken up by repeated volleys of canisters fired by the police".

The name-change agreement is the result of a dispute between Macedonia and Greece over history and national identity that has lasted 27 years.

Many Greeks are alarmed by the agreement, saying it recognises a Macedonian nationality, which could ignite competitive claims on ancient Greek history and heritage.

"The substance of the protest is that Greeks are unhappy with the agreement," said Psaropoulos.

Protester Natasha Afanasiadou told the Associated Press there was "no way" she could not come to the demonstration as she did not want to look back on what was happening and think she had not protested against it.

Greece and Macedonia, whose official name is the Former Yugoslav Republic of Macedonia, agreed last June to a deal that would change the name of Greece's northern neighbour.

In exchange, Greece would lift its objections to the country joining NATO.

The agreement has led to challenges for Greek Prime Minister Alexis Tsipras, who has survived two no-confidence votes since it was made. The demonstration is the latest challenge for Tsipras's policy on Macedonia's name.

However, it's "unlikely because the PM has said very consistently … that he will bring his ratification to Greek Parliament", Psaropoulos said.

Greece's parliament is expected to start a debate on ratification of the deal on Monday and vote on it by Friday.