Malaysian royals are voting on a new king after the previous monarch, in an unprecedented move, abdicated the throne before the end of his term.

A new ruler, known as the Yang di-Pertuan Agong, is usually picked every five years.

But Sultan Muhammad V abdicated in January after just two years on the throne, a first in Malaysian history.

Malaysia has a constitutional monarchy. However, the rulers do not participate in daily governance.

A new ruler is expected to be sworn in on 31 January.

In November, Sultan Muhammad V went on medical leave. Later that month, photos emerged on social media that appeared to show his wedding to a former Miss Moscow in the Russian capital.

Muhammad V, who was 47 when he was sworn in, has garnered a reputation for his enthusiasm for extreme sports like off-road driving, shooting and endurance challenges.

His shock abdication has put the spotlight on Malaysia's unusual monarchy, the only rotational monarchy in the world.

The role of the Yang di-Pertuan Agong dates back to 1957 when the Federation of Malaya was declared independent from the British Empire.

There are nine Malay rulers from nine of the 13 states that make up Malaysia. These rulers are elected as king on a rotational basis by the Conference of Rulers.

The Conference of Rulers is a council made up of the nine Malay rulers as well as governors from the four remaining states without a royal family.

However, in the election of the Yang di-Pertuan Agong, only the nine sultans will have a vote.

How is the new king selected?
The Conference of Rulers will gather to elect the next king based on a particular order of the nine Malay rulers which was set back when the office of the Yang di-Pertuan Agong was first established in 1957.

The selection is based on a rotational system where the ruler of the state next in line is typically elected.

The next state in line is Pahang, however the ruler of the state was only sworn in on 15 January, throwing into question whether he will get enough votes, according to state media agency Bernama, citing constitutional law expert Shamrahayu A Aziz.

The nine Malay rulers will be given a ballot paper with only one name, typically the name of the sultan from the state next in line. They will then anonymously indicate if they think the sultan is suitable or not for the role.

A ruler must secure a five-vote majority to be the next king. If he does not secure enough votes or declines the position, the election process is repeated with the name of the sultan from the state next in line.

To ensure anonymity, the nine rulers are given unnumbered ballot papers with identical pens and ink.

What power does the king have?
The position is largely ceremonial, with power in the hands of parliament and the prime minister.

The king does not participate in the daily governance of the country. He is in charge of major appointments like that of the role of prime minister.

The king is also the head of Islam in Malaysia and commander-in-chief of the armed forces.

He also has the power to grant pardons which is what the previous king did for former opposition leader Anwar Ibrahim after his coalition's shock victory during last year's general elections.

Mr Anwar was pardoned from a second conviction for sodomy which was widely seen as politically motivated.

The role of Yang di-Pertuan Agong is accorded considerable prestige, particularly among the country's Malay Muslim majority, for whom the king is seen as upholding Malay and Islamic tradition. Criticism deemed to incite contempt of the king can attract a jail term.

Most recently after Muhammad V's resignation, online vigilantes were seen policing social media and releasing personal information of anyone found criticising the monarchy.

According to local news site Malay Mail, a Facebook page was set up listing eight individuals of which at least three were investigated under Malaysia's Sedition Act while another four were either fired, suspended or resigned from their jobs.