"After taking into consideration the views of Their Royal Highnesses the Malay Rulers, His Majesty has given consent to appoint Anwar Ibrahim as the 10th Prime Minister of Malaysia," the statement said.
At the weekend election, Anwar's Pakatan Harapan (Alliance of Hope) coalition won the most seats, 82, on an anti-graft message -- but fell short of the required 112-seat majority.
Former prime minister Muhyiddin Yassin's Perikatan Nasional (National Alliance) bloc grabbed 73.
Muhyiddin, who was backed by an Islamist party, later told reporters that since no bloc had enough numbers, the king had initially asked him and Anwar to form a "unity government".
Malaysia's king, Sultan Abdullah Ahmad Shah, had summoned the two rivals in a bid to break the deadlock.
The biggest party in Malaysia's ruling alliance declared on Tuesday that embattled Prime Minister Muhyiddin Yassin has lost the right to govern because a number of its lawmakers have signed declarations withdrawing their support.
He told senior news people that the government will hold by-elections as per the Constitution if the PDM tendered resignations from the assemblies. He said the local elections will be held after the Senate polls in April 2021.
He pointed out the issues facing the country, including inflation and the current political situation a day after the Opposition's Pakistan Democratic Movement (PDM) held its first power show in Gujranwala.
The project could cause more instability at Twitter at a time when the company is facing a severe engineering talent crunch, the report said late on Tuesday, quoting current employees.
Senior police official Azhar Mehesar told AFP the blast targeted a police team preparing to escort polio vaccinators in the city of Quetta and that those killed "include a policeman, a woman and a child".
"Despite extremely big Russian losses, the occupiers are still trying to advance in the Donetsk region, gain a foothold in the Luhansk region, move in the Kharkiv region, they are planning something in the south," he said.
Ukraine's General Staff said on Wednesday its forces had repelled six Russian attacks in the past 24 hours in the eastern Donbas region, while Russian artillery had relentlessly shelled the right bank of the Dnipro River and Kherson city further south.