ATHENS — Overcoming Russian meddling in the Balkans and intensive domestic opposition, Greek lawmakers on Friday cast a wrenching vote to set aside historical antagonisms and recognize the newly renamed nation of North Macedonia, in a rare victory for the European Union and NATO.

The 153 to 146 vote by the Greek Parliament now essentially clears a path for Greece’s northern neighbor Macedonia, under its new name, to join NATO and potentially the European bloc, strengthening the West’s foothold in the Balkans over Moscow’s protests.

Greece had fiercely objected to its neighbor’s use of the name Macedonia, arguing that it appropriated Greek history going back to Alexander the Great and implied territorial ambitions over the northern Greek territory of the same name.

The issue has stirred months of mass demonstrations in Greece, and the decision to support the deal by Prime Minister Alexis Tsipras, who has sought to burnish his reputation as a statesman, may yet come back to haunt his government in elections this year. Polls show well over 50 percent of Greeks opposed to the new name, as well as the old one.