"Today is a historic day", Greek Prime Minister Alexis Tsipras, who forged a close relationship with North Macedonia counterpart Zoran Zaev in drafting the agreement a year ago, said in a tweet.
Greek opponents of the deal plan to protest outside parliament Thursday night to defend the "Greekness" of Macedonia.
Under the agreement, Macedonia will change its name to the Republic of North Macedonia.
"Today's success is a proof that progressive political forces are able to solve long-standing disagreements and make hard compromises which nationalists or conservatives had not been able to do in nearly three decades".
Ratification of the deal in Athens is an important victory for the Greek Prime Minister. "For eternal peace and progress of the Balkans and in Europe!" he wrote.
The deal, approved in a 153-146 vote, was the final step in a precarious seven-month process that has included street protests, nationalist opposition, alleged Russian attempts at interference, and acrimonious paths to ratification in both countries.
Prime Minister Alexis Tsipras, who hammered out the deal with his Macedonian counterpart past year, on Friday secured the parliamentary majority needed to get the accord approved with support from independent and opposition MPs.
Macedonia, for its part, will notify all worldwide institutions of its name change and begin making the necessary changes in its own national institutions.
The Greek prime minister said on Friday that North Macedonia had been born, however it will still take time for the name to be formally declared.
"Congratulations my friend Alexi Tsipras, together with our peoples we reached a historical victory", Macedonian Prime Minister Zoran Zaev tweeted.
Tsipras said that the previous failures to solve the long-standing dispute had deprived Greece of precious diplomatic capital, and he accused the conservative opposition New Democracy party, which opposed the agreement, of being hypocritical. Some Greeks say that Macedonians are making unjust claims over Greek territory or heritage.
"Macedonia will become North Macedonia in about two weeks", a Macedonian foreign ministry official who asked to remain anonymous told AFP Saturday. They note that just a few years back, Skopje enthusiastically sought to appropriate Alexander the Great, ancient king of Macedon and one of Greece's greatest heroes. Until the crossing reopened late Thursday, most traffic was diverted to two other border crossings.
Greeks have rallied against the deal several times since it was agreed last June, and tens of thousands of people demonstrated outside parliament on Sunday.
Athens in 2016 accuses Skopje of excessive use of force against hundreds of migrants, many fleeing the war in Syria. The MP Grigoris Psarianos abstained, casting a vote of "present'".
Mr Tsipras, who was involved in negotiating the deal, said it was a "historic day".
U.S. Secretary of State Mike Pompeo welcomed the Greek parliament's move, praising the government's "vision, courage and persistence" in pushing ahead with the historic agreement.