Though largely a ceremonial post, Malaysia's monarch still signs off on most laws and appointments, including the prime minister, and hours after Mahathir and his alliance's stunning general election victory last May, King Sultan Muhammad V offered the job to someone else.
The offer was rejected and Mahathir heaped pressure on the king by holding a series of news conferences. The king subsequently signed off on Mahathir, but the hours of uncertainty put the spotlight on Malaysia's monarchy at a time when some of the royals are seeking to reassert their influence in politics.
Though Malaysia has only had a constitutional monarch since 1957, several of Malaysia's nine royal families trace their roots to centuries-old Malay kingdoms that were independent states until they were brought together by the British.
Sultan Muhammad V became the nation's first king to give up his post when he abruptly abdicated on Jan. 6 without explanation. Now the nation waits for Thursday's meeting of the royal families in which they will choose a replacement.
Here's a closer look at Malaysia's monarchy:
ROYAL DYNASTIES
Traditional ethnic Malay rulers — mostly known as the sultan — constitutionally head nine of Malaysia's 13 states, forming one of the world's largest monarchy systems. Seven of the royal families are hereditary monarchies, with the northern Kedah sultanate one of the oldest unbroken dynasties in the world, dating back to the 12th century.
In Perak state, the second oldest ruling house in Malaysia, three royal families take turns to ascend the throne based on seniority. The ruler in Negeri Sembilan state, where the royal lineage is linked to the Minangkabaus from west Sumatra in Indonesia, is elected by a council of four territory chiefs.
All the families are headed by ethnic Malay Muslims males, as required.
Some of the royal families, especially those in the wealthy states of Selangor and Johor, have built-up large business interests. The most prominent is billionaire Sultan Ibrahim Ismail of Johor, who owns a fleet of jets and loves Harley-Davidson motorcycles. The Johor sultan is also the most powerful, having his own army — a condition agreed upon for the state to join modern-day Malaysia. His army's role is largely ceremonial today.
___
PICKING A KING
Malaysia's constitutional monarchy was put in place after the country's independence from Britain in 1957.
The nine heads of the royal families take part in what is known as the Conference of Rulers and every five years elect one among themselves to be Malaysia's king through a secret ballot.
The throne was initially rotated based on seniority, but there is now an established rotation order from one state to the next, making the vote more of a formality. Royals, however, can choose divert due to health or other issues.
___
NEXT IN LINE
The ruler of central Pahang state is next in line to be king. Sultan Abdullah Azlan Shah succeeded his ailing 88-year-old father on Jan. 15, in a move seen as paving the way for him to become the next king.
Sultan Abdullah, who was state regent for the past two years due to his father's ill health, is active in the sports. He is president of the Asian Hockey Federation and a council member of world football governing body FIFA.
Sultan Abdullah, 59, must be supported by at least five of the state rulers. Next in order after Pahang, is Johor state.
___
HISTORIC ABDICATION
King Sultan Muhammad V shocked the nation by announcing his abdication this month, days after returning from two months of medical leave. The 49-year-old sultan from eastern Kelantan state only reigned for two years as Malaysia's 15th king and didn't give any reason for quitting.
During his leave, it was reported that the king married a 25-year-old former Russian beauty queen. Photos of the two at a wedding reportedly held in Moscow were circulated in the British and Russian press and on social media. Neither the king, the palace nor the government have confirmed the wedding.
It marked the first abdication in the nation's history. Three other kings didn't finish their reign, but that was due to their deaths.
___
THE SULTAN'S ROLE
The state rulers are highly respected among Malay Muslims, who account for two-thirds of Malaysia's 32 million people, and are seen as guardians of Islam and Malay traditions.
In addition to ceremonial duties, they can withhold consent for the dissolution of their state's assembly and the appointments of their state's chief minister.
During his first stint as prime minister, Mahathir pushed through constitutional amendments that stripped the sultans of their power to veto state and federal legislation. The amendments also removed their legal immunity following a series of scandals involving the Johor royal family. A special court has been set up to prosecute royals, but cases are rare.
___
HE WHO IS MADE LORD
Known as the Yang Di-Pertuan Agong, or He Who is Made Lord, Malaysia's king resides in a 650- million-ringgit ($158-million) palace in Kuala Lumpur.
The king's duties, similar to those of the British monarch, are largely ceremonial since administrative power is vested in the prime minister and parliament. He is the nominal head of the government and armed forces.
All laws, cabinet appointments and dissolution of parliament for general elections require his assent. The king also issues pardons for criminals.
Public criticism of the king and state sultans is generally illegal. Under Malaysian sedition laws, people who incite "hatred or contempt" toward the monarchy can be imprisoned for three years.
Malaysia's constitution allocates some 5 million ringgit ($1.21 million) a year for the expenses of the king and his household, including palace maintenance, although the sum can be increased with cabinet approval.
___
POLITICAL STATEMENTS
The king and some state rulers have been vocal in politics in recent years. In 2015, the nine rulers issued a rare joint statement calling for a swift investigation into a massive corruption scandal at the 1MDB state investment fund.
The scandal promoted public anger that eventually led to a historic change of government in last May's polls.
Last year, the Selangor state sultan also appointed a new chief minister who had not been formally proposed by the government. King Sultan Muhammad V also sought to block the appointment of a non-Muslim attorney-general last year but gave in after Mahathir's government refused to budge on its candidate.