BELGRADE (Reuters) - Macedonia’s must resolve a decades-long dispute over its name, implement judicial reform and build good relations with neighboring countries to join NATO, the Western military alliance’s Secretary General Jens Stoltenberg said on Thursday.

The country’s efforts to join NATO and the European Union have been blocked by Greece, which says the name Macedonia implies a territorial claim over Greece’s own northern region of that name.

Until the row is resolved, Athens has agreed only that the country be referred to internationally as “FYROM” (Former Yugoslav Republic of Macedonia), the name under which it was admitted to the United Nations in 1993, though the two states last week agreed to hold talks on the matter.

“NATO’s door remains open,” Jens Stoltenberg told journalists on Thursday after meeting Macedonia Prime Minister Zoran Zaev.

He said resolving the name dispute is crucial for Macedonia to join NATO, but urged the country to improve the rule of law, build good relations with neighboring nations and develop a multi-ethnic society.

“It’s not easy, but it can be done,” Stoltenberg said.

In 2001 NATO and Western diplomacy pulled Macedonia from the brink of civil war during an ethnic Albanian insurgency and promised it faster integration into the EU and NATO.

Zaev’s government, which took power last May, pledged to work on resolving the name dispute and accelerate the country’s EU and NATO bid.

The EU and NATO see the Western Balkan region as important for issues from controlling immigration to countering security threats.

NATO has noted important progress on transparency, accountability, oversight of the intelligence and security agencies and judicial reform, Stoltenberg told the Macedonian parliament on Thursday.

“That must continue,” he said. “We hope to see similar progress on electoral reform, reform of the media and greater transparency in government finances.”