Election officials in Macedonia say that with ballots from almost half of polling stations counted, more than 90 percent of voters approved of a deal with Greece that would change the country's name to North Macedonia in order to open the way to NATO membership.
The referendum was recognized as valid, it is necessary that in it participated not less than 50 percent of the citizens.
Macedonian Prime Minister Zoran Zaev (C) holds a press conference after the voting ended in the "name" referendum.
Political analysts said the lack of a decisive referendum outcome greatly complicated the tiny ex-Yugoslav republic's push to join Western structures.
Guterres reiterated the UN's commitment "to provide all necessary support, if required" including through his personal envoy and United Nations agencies, Haq said. "I can not give up my Macedonian identity".
Greece's refusal to recognize Macedonia as a country has barred it from participating in global groups, such as NATO and the EU.Greece insists Macedonia designate itself as "North" to differentiate the country from Greece's own province of Macedonia, the birthplace of Alexander the Great.
Opponents in Macedonia include the country's president, Gjorge Ivanov, who has called the deal a "flagrant violation of sovereignty".
"The government has lost its legitimacy, and the only thing remaining is to respect the will of the people", Mr Hristijan Mickoski, leader of the main centre-right opposition party, VMRO-DPMNE, wrote on Facebook.
"The policy of the government received a debacle today", he said. Opponents to the deal have called for a boycott of Sunday's vote.
But Russians have been accused of fomenting protests against the deal in neighbouring Greece, forcing Athens to expel two diplomats over the allegation in July.
Macedonia should "continue to implement this agreement", Greek leader Alexis Tsipras told Zaev by phone after the result came out. "This opportunity must not be wasted", he said.
However, the party that ruled Macedonia for a decade until 2017 was split during the referendum campaign.
Stoltenberg said that the recent agreement on the renaming of the country into the North Macedonia with Greece and the end of a long-term conflict was "a historic agreement, which provides a historic opportunity" for Skopje to join NATO. Macedonian nationalists began producing maps including Thessaloniki, Greece's second-largest city.
Greece also expelled Slavic-speaking Macedonians from its territory after World War II.
The animosity deepened when Macedonia's former premier Nikola Gruevski went on a construction spree in the capital Skopje, erecting massive statues of Alexander the Great - a hero both countries claim as their own - and plastering government buildings in Hellenic-inspired facades.
The referendum is one of the last hurdles for a deal reached between Macedonia and Greece in June to settle their quarrel, which has prevented Macedonia from joining major Western institutions since it broke away from then-Yugoslavia in 1991.
"The climate of nationalism and suspicion, daily fake news, and extreme fanaticism unfortunately do not allow a sober assessment of the great benefits of the agreement", the Greek Foreign Ministry said in a statement.
The EU's enlargement chief, Johannes Hahn, followed Zaev in trying to put a positive spin on what happened.
Supporters of a voter boycott of Macedonia's referendum on changing the country's name to North Macedonia to pave the way for NATO membership are starting to celebrate based on low turnout figures election officials gave before polls closed.
"I now expect all political leaders to respect this decision and take it forward with utmost responsibility and unity across party lines", European Union enlargement commissioner Johannes Hahn said in a statement.