KUALA LUMPUR (Reuters) - Members of Malaysia’s royal families on Thursday elected Sultan Abdullah Sultan Ahmad Shah as the new king, following the unexpected abdication of the previous monarch.

Sultan Abdullah, 59, ruler of the central state of Pahang, will formally take over the throne on Jan. 31 for a five-year term, the keeper of the rulers’ seal said in a statement.

Malaysia is a constitutional monarchy with the king assuming a largely ceremonial role, including acting as custodian of Islam in the Muslim-majority country. The king’s assent is needed for the appointment of a prime minister and various senior officials.

Malaysia’s nine royal households take turns to provide a king, who is chosen through a vote in a Council of Rulers, made up of the nine households, most of which are led by a sultan.

The king is elected for a five-year term.

The head of the Pahang royal family was next in line in take over from the former king, Sultan Muhammad V, who is the head of the state of Kelantan.

Sultan Muhammad abdicated this month after just two years on the throne, the first time a monarch had stepped down before completing their tenure.

No reason was given for his decision, which came after images purporting to show him getting married in Russia appeared on social media in December. Posts identified his new wife as Oksana Voevodina, who won a Miss Moscow contest in 2015.

The new king, Sultan Abdullah, succeeded his ailing father as ruler of Pahang last week.

His ascent to the Pahang throne, was seen as a sign that he would take over as the new monarch.

Sultan Abdullah is on the non-executive supervisory council of football governing body FIFA. He is also the president of the Asian Hockey Federation.