Several demonstrators complained of breathing problems.
But in Skopje special police fired tear gas after some among 2,000 people protesting in front of the parliament hurled stones and flares and attempted to break through a police cordon.
"By signing the agreement... we have really moved mountains", he said, and offered Tsipras his tie.
The definition of the country's language will remain "Macedonian", as Skopje insisted in the talks.
Macedonian government spokesman Mile Bosnjakovski said Prime Minister Zoran Zaev's Cabinet approved the deal he reached last week and forwarded it for parliament's approval. "Our countries are leaving the past behind and are looking to the future".
The agreement now needs to be confirmed by both countries' parliaments, and in Macedonia, by citizens in a referendum.
The Greek side should also ensure that its northern neighbours did not copy strong Greek brands linked to Macedonia.
In Greece, where up to 70% of the population reject the compromise, New Democracy - who is favoured to win the next election - issued a sombre statement "Today is a sad day for Greece, but it is also a day of shame for Prime Minister Alexis Tsipras and his coalition partner Panos Kammenos". After a complex procedure, which will take months, the country will become the Republic of Northern Macedonia.
Father of Arsenal, Chelsea target Aleksandr Golovin hints at move
It now remains to be seen whether Sarri succeeds at what Conte failed to do at Chelsea; convince the board to sign Mertens. At Chelsea I think it will be the same".
After the deal is approved, Greece will lift its objections to the renamed nation joining the European Union (EU) and North Atlantic Treaty Organisation.
Skopje hopes to secure a date to begin European Union accession talks at a bloc's summit in late June and an invitation to join North Atlantic Treaty Organisation in mid-July.
But an European Union official expressed cautious optimism that the Macedonian settlement, which must be approved by both countries' parliaments, will have a positive psychological effect.
Zivaljevic was present during a violent episode on April 27 past year, when a group of men stormed the Macedonian parliament in Skopje in an attempt to prevent Zaev forming an administration.
Both Tsipras and Zaev have faced an uphill struggle to get the deal this far, with the Greek premier undergoing - and surviving - a no-confidence motion launched by the opposition over the name deal.
"Today's my birthday. I told my family this year I don't need any [other] gifts", Matthew Nimetz, a 79-year old United Nations diplomat, who helped negotiate the deal, said. They also chanted the name of President Gjorge Ivanov, who has pledged to veto the deal if it is ratified by parliament.
Macedonia was admitted to the United Nations in 1993 under the provisional name of the "Former Yugoslav Republic of Macedonia", but more than 120 countries including Russian Federation and the United States have recognised the Balkan country under the name of "Republic of Macedonia".
Macedonians are the ethnic majority, but Albanians make up between one-quarter and one-third of the 2.1 million inhabitants.
- Russian Federation beats Saudi Arabia in the World Cup opener in Moscow
- The Complete and Final 2018 NBA Mock Draft
- Texas cop 'abused migrant girl and threatened to deport mum'
- Oppo shows Apple how to eliminate iPhone’s notch with style
- Recording of Children Crying Adds to Anger over US Policy
- Lord Sugar apologises after his Senegal football team tweet 'backfired'
- Illinois Republicans in Congress break from Trump over border children
- Senegal and Japan fans tidy up after their World Cup matches
- Video games 'as addictive as cocaine or gambling'
- Willemse to approach Equality Court