Updated

A United Nations envoy said Thursday he remained optimistic that neighbors Macedonia and Greece could resolve a name dispute that has strained relations between the two countries for more than a quarter of a century.

After talks with Macedonian leaders in capital Skopje, Matthew Nimetz told reporters that officials in both countries are highly motivated to move forward with efforts in finding a solution over the name within the next couple of months.

"I am very, very optimistic. There is a window of opportunity and I think we should go forward quickly and move to solution in the next couple of months," Nimetz said after traveling to Skopje following talks in Greece.

The dispute broke out after Macedonia, for decades a part of the former Yugoslavia, gained independence in 1991. Greece says the neighbors name implies claims on its own province of Macedonia — home of ancient Greek warrior-king Alexander the Great — and wants it changed. The Macedonian government denies the charge.

Greek officials favor a compound name that will somehow qualify the word Macedonia by adding a modifier "Upper", "New" or "North".

NATO member Greece has blocked Macedonia's accession to the alliance since 2008 until a solution on the name is found.

Speaking at the same news conference, Macedonian Foreign Minister Nikola Dimitrov said Skopje wants a solution that will be "dignified" for the people in both countries — but also a solution that would not endanger Macedonia's national identity and language.

During Nimetz's visit, about 200 people gathered in front of the offices of the European Union mission in Skopje to protest ongoing talks, demanding their termination.

On Sunday, a rally is planned in Athens against the proposed compromise that is expected to draw large crowds. The Greek Orthodox church has endorsed the rally, as well as influential organizations representing the Greeks communities in the United States and Canada.