President Gjorge Ivanov handed the mandate to Social Democratic (SDSM) leader Zoran Zaev, who won the support of a parliamentary majority including ethnic Albanian parties.
The president had earlier refused to grant the SDSM a mandate, saying national unity would be undermined by the demands of Albanian groups.
But in a turnaround, he told reporters that "the SDSM has secured a majority and I formally grant a mandate to the party with the parliamentary majority."
The country of around two million people, which aspires to join both the European Union and NATO, has been mired in a deep political crisis for two years since a huge wiretapping scandal erupted.
Although his party narrowly won the most seats in the December vote, Gruevski was unable to strike a deal with kingmaking Albanian groups.
The SDSM then won their support, but nationalist protesters took to the streets in opposition to the proposed coalition government.
When the SDSM and its allies last month elected a new parliamentary speaker, an ethnic Albanian, protesters stormed the building and dozens of people were injured - including Zaev.
Disclaimer: No Business Standard Journalist was involved in creation of this content
