KUALA LUMPUR, Malaysia (AP) — Reformist leader Anwar Ibrahim has won a hard-fought battle to become Malaysia’s new prime minister. But working with former foes to form a unity government as a polarized nation watches will immediately test his political mettle.

There is no honeymoon period for Anwar, 75, who got straight down to work less than 24 hours after he was sworn in as the nation’s 10th leader.

National television showed Anwar clocking in Friday morning at the government administrative capital of Putrajaya. His first test will be the construction of a Cabinet and the distribution of portfolios to appease the diverse members of his unity government.

Anwar promised Monday that his Cabinet will be leaner compared to the previous, oversized administration, and said he will forego his salary as prime minister amid the country’s economic slowdown. He said new Cabinet members would be asked to cut their salaries, too.

“My main priority now is the cost of living,” he told a news conference.

Anwar pledged to work swiftly to find ways to help Malaysians struggling with rising food costs, a currency at its lowest point in over two decades and stagnating wages ahead of an expected economic slowdown next year.

Anwar’s Pakatan Harapan, or Alliance of Hope, won 82 out of 222 seats in the Nov. 19 general election. To cobble a majority, he won support from two key rival blocs: the long-ruling National Front, which has 30 seats, and the Sarawak Parties Alliance with 23. Several smaller blocs have said they will also join.

Former Prime Minister Muhyiddin Yassin’s Malay-centric National Alliance unexpectedly won 73 seats. Muhyiddin’s hard-line ally, the Pan-Malaysian Islamic Party that touts Sharia, took 49 seats to become the country’s single largest party in an indication of the rise of conservative Islam.

Anwar’s victory with support from political rivals marked another “watershed moment that heralded a new era for Malaysian democracy,” said Ahmad Fauzi Abdul Hamid, political analyst with the University of Science, Malaysia.

It came on the back of his alliance’s stunning victory in 2018 polls, which ended the National Front’s 60-year grip on power and led to the country’s first regime change since independence from Britain in 1957. But the new government crumbled after power grab that led to turmoil and saw a total of three prime ministers in four years. Anwar was in prison at the time on a sodomy charge he said was politically motivated.

Anwar fostered a conciliatory tone after his appointment, welcoming all parties to his government as long as they adhere to the basic rules of good governance, no corruption and a “Malaysia for all Malaysians.”

Analysts said the makeup of his Cabinet will provide a clearer picture of his policies going forward, as he puts flesh to bones on his campaign promises to clean up the government and heal deepening racial and religious gashes. His anti-corruption platform will be tested amid concerns that concessions will be made for some National Front leaders battling graft charges in return for their support.

An ethnic Muslim, Anwar must also earn the trust of conservative Malays, who viewed him as too liberal and opted for Muhyiddin’s right-wing bloc in the contentious election. Police have tightened security and Anwar’s supporters have been told to hold off celebrations that may provoke Islamic supporters.

In such a racially charged environment, Anwar’s aims — including replacing a decades-old affirmative action plan that gives privileges to Malays in jobs, education and housing — may be a minefield.

Anwar has assured Malays that their rights under the constitution and the position of Islam as the national religion will be protected. But he stressed that other races must not be marginalized so that the country can be united.

“Racial divide has been in existence in Malaysia since independence,” said political analyst Ahmad Fauzi.

“Anwar will come up with his own formula to rein in the problem, but thinking that he’ll be able to extinguish it is to expect the impossible from him,” he added.