Mr Anwar was sworn in as PM by the monarch in an official ceremony on Thursday evening.
“The people should not be burdened by endless political turmoil as the country needs a stable government that will boost the economic landscape and national development”, Sultan Abdullah said.
Mr Anwar's opponent, former prime minister Muhyiddin Yassin, refused to accept the result, claiming his bloc had gained a majority of 115 seats in parliament after refusing to join a coalition requested by the king.
Mr Anwar’s Alliance of Hope led Saturday’s election with 82 seats, short of the 112 needed for a majority.
The incoming prime minister, 75, has had a turbulent journey to top office, coming close to the premiership several times.
He spent more than a decade in jail on what he said were politically motivated charges.
Mr Anwar was seen as former prime minister Mahathir Mohamad’s successor back in the 1990s and was expected to replace him after the 2018 election, only for the plans to unravel both times.
Mr Yassin said he would not join him in a coalition government, leaving Sultan Abdullah with no choice but to appoint a new prime minister to break the deadlock.
The former leader, who allied with an Islamist party in Saturday's vote, secured 73 seats with his National Alliance bloc. His party initially said it was willing to enter a coalition with "like-minded parties" but would not join forces with Mr Anwar's more progressive bloc.
His co-operation with the Malaysian Islamic Party (PAS) stoked fears of division in the multi-ethnic country, with PAS advocating rule based on a strict interpretation of Sharia.
On Wednesday, TikTok said it was on “high alert” and in touch with Malaysian authorities over content related to the elections on its platform. Security was boosted across the country and police urged social media users not to post "provocative content" ahead of the vote.
Mr Anwar “has been seen to be a bridge builder across communities, which will test his leadership moving forward but at the same juncture offers a reassuring hand for the challenges that Malaysia will face”, political expert Bridget Welsh told AFP.
His rule is hoped to usher in a much-needed economic recovery and ease ethnic tension laid bare in the elections at the weekend.