Nikola Dimitrov, Macedonia’s foreign minister, said NATO membership would place the country in “a zone of stability in a region that still has pockets of uncertainty.”

“Macedonia can be the precedent for how issues should be resolved in the rest of the Balkans,” Mr. Dimitrov said.

Russia continues to be wary of NATO expansion in Eastern Europe because of the alliance’s historical role as an opponent of the Soviet Union.

Western officials had accused Russia of interference in the name-change process, with Defense Secretary Jim Mattis, during a visit to the Macedonian capital, Skopje, voicing concerns that groups financed by Russia were trying to undermine the deal.

How did this all start?

The name hasn’t always been a major point of contention with Greece. While the dispute dates back at least to the first Balkan wars of the 1910s, it receded for most of the 20th century, when Macedonia was part of the socialist federation of Yugoslavia. Since it was an entity of another country, Greece made few objections to its use of the name at the time.

The difficulties flared when Yugoslavia disintegrated and Macedonia declared its independence in 1991, as well as its intention to join international organizations that included Greece.

Macedonia entered the United Nations in 1993 under a provisional name, the Former Yugoslav Republic of Macedonia, or Fyrom. While the name made the country’s provenance clear, it did not entirely resolve the issue, since Macedonia did not refer to itself internally as Fyrom. Greece accused it of appropriating Greek symbols and cultural identifiers, such as the Vergina Star — a similar image appears on the current Macedonian flag.