He has overseen the transition of Malaysia from a backwater, rural society to a modern, high-tech power.
This is an unprecedented achievement which has led many to laud his country as a bastion of modern Islam.
But despite this, Mahathir will probably be best remembered for his more frivolous side.
One minute he would accuse the Jews of running the world “by proxy”, and the next he would castigate the Australians for imposing their values “as if it was the good old days when people could shoot aborigines”.
Mahathir has also alienated many by his autocratic style and his refusal to brook any opposition to his rule.
After 22 years in power, he leaves behind him a middle-class nation that is a significant player on the world scene.
But his legacy will also be a deeply divided society whose main battleground has switched from one of race and class to religion.
Mahathir Muhammad, 77, was born and educated in Alur Setar, capital of the Northwestern state of Kedah.
A qualified doctor, he practised his trade in a rural area which influenced his lifelong sympathy for the disenfranchised.
His political career began in 1946, when he joined the newly founded United Malays National Organisation (Umno).
However, in 1969 he lost his parliamentary seat and was expelled from the party after attacking the then Prime Minister for neglecting the Malay community.
In his famous 1970 book, the Malay Dilemma, he wrote that Malays had been marginalised during the colonial era and urged them to reject their second-class status.
Following the success of the book he was invited back into the party, re-elected to parliament in 1974, and appointed minister of education.
Within four years he had risen to deputy leader of Umno, and in 1981 he became prime minister.
"They are... very greedy and like to take forcibly the territories and rights of other people"
"Disunited, confused about Islam, fighting each other for power and lacking in essential knowledge and skills... Muslims today have reached the lowest point of their development."
On gay British MPs
"The British people accept homosexual ministers but if they ever come here bringing their boyfriend along, we will throw them out."
Dr Mahathir immediately set about putting his ideas into practice - a major dose of modernisation and an "affirmative action" programme that gave Malays a guaranteed share of educational and other opportunities.
He transformed Malaysia from an exporter of rubber and tin into a manufacturer of electronic equipment, steel and cars.
His prestige projects to boost national pride included one of the world's tallest buildings - the Petronas Towers.
With the onset of the Asian economic crisis in 1997, Mahathir blamed foreign currency traders for what he termed a worldwide Jewish conspiracy.
But Malaysia emerged relatively unscathed after he defied the International Monetary Fund, introducing controversial currency controls which effectively isolated his country from the global economy.
The economic successes of Mahathir's premiership are plain to see.
Incomes have tripled and poverty levels have fallen; two thirds of the population now live in cities; and the share of national wealth held by Malays has risen from 9% to more than 20%.
Nevertheless, Mahathir’s achievements will always be tainted by his poor human rights record.
While during the past two decades many Malaysians have enjoyed rising standards of living, they have been unable to exercise basic political rights.
Criticism of Mahathir intensified after the September 11 attacks when he offered his full support and cooperation to the United States.
He was accused of using the US-led "war on terrorism" as an excuse to neutralise Islamist political opponents at home.
"Mahathir ran a paternalistic government that tried to decide what was right for the Malaysian people... Now the people of Malaysia should be free to make these choices as they see fit"
Human Rights Watch
Scores of suspected Islamists were arrested without trial under the much-criticised Internal Security Act.
The act allows the government to detain individuals indefinitely, and is said to violate international human rights standards.
On Wednesday, a rights group warned Malaysia's incoming prime minister Abd Allah Badawi he should repeal the repressive act to open up Malaysia's tightly controlled political climate.
Human Rights Watch (HRW) said after assuming power in 1981 that Mahathir used various repressive laws to silence or even imprison his critics.
"Mahathir's human rights legacy is not one to be proud of. Badawi needs to do things differently on human rights," said Brad Adams, executive director of the Asia Division of Human Rights Watch.
In an open letter to Badawi, HRW also urged the incoming prime minister to ensure the independence of the judiciary, and to end media censorship.
"Mahathir ran a paternalistic government that tried to decide what was right for the Malaysian people," Adams said. "Now the people of Malaysia should be free to make these choices as they see fit."
Perhaps the most notorious example of Mahathir’s autocratic style was his treatment of his former deputy, Anwar Ibrahim.
Anwar was arrested in September 1998 days after leaving Mahathir's government and leading protests against him.
He was accused of sodomy and corruption and expelled from the party. He is still serving the resulting jail sentences.
Ironically, Ibrahim had originally been co-opted by Mahathir to stave off opposition from Malaysia's Islamists.
But Malaysia’s Islamic movement has become even stronger since Anwar's incarceration, and has criticised Mahathir for abandoning his Islamic principles.
The Islamic Party (PAS) picked up new seats at the last general election in 1999, and they are now calling for an Islamic state.
Abd Allah Badawi will have a hard
act to follow
Overall PAS won about 60% of Malay Muslim votes and is expected to win more seats at the next general election, which is due next year.
Ironically, the very constituencies he originally argued against - the Chinese and Indians - now wish he would stay on.
There is little doubt the non-Muslim Chinese and Tamil communities regard Islamist influence throughout Malaysia with deep dismay.
They feel Mahathir is better placed to stave of PAS's challenge than the Islamist-leaning Badawi.
Which side truly represents Islam - the secular Muslim government or the Islamist opposition party - is now the main issue in Malaysian politics.
Mahathir Muhammad has been a towering presence over South East Asian politics for more than two decades.
There is no doubt that his successor, Abd Allah Badawi, will have an almost impossible act to follow.
It is unlikely that Badawi will change Mahathir's business policies that have brought so much prosperity to the country.
But if Malaysia's highly educated, middle class population is not given more of the freedom it craves, the country may be in for a social explosion.