The 92-year-old, who returned to politics after a decade-and-a-half, ousted Najib Razak.
Malaysian Prime Minister Najib Razak has suffered a stunning election loss to former leader Mahathir Mohamad, who at 92 is set to become the world’s oldest leader.
His historic win has ousted the Barisan Nasional coalition, which has been in power since independence in 1957.
Mahathir said his coalition would “restore the rule of law”.
Najib has not yet commented on his dramatic loss.
Official results showed the opposition Pakatan Harapan -- the Alliance of Hope -- had secured 113 of the 222 being contested, including some which have never before been taken by the opposition. BN took 79 seats.
Announcing his victory in Kuala Lumpur, Mahathir said his coalition had secured “not just a few votes, not just a few seats, but a very substantial majority”.
He said he hoped a swearing-in ceremony would be held on Thursday and announced -- to cheers among his supporters -- that there would be a two-day holiday.
According to a statement by the country’s Election Commission, over 76 per cent of the 14.3 million eligible voters in the country turned out to cast their ballots. The turnout was lower than the 85 per cent the country saw in 2013.
While the defeat surely spells the end of Najib’s political career, for Mahathir, it represents the culmination of a stunning return to power, a decade-and-a-half after retirement.
PHOTOS: Modi mania sweeps Malaysia
Malaysia's Najib calls Modi 'man of action'
Malaysian PM Razak meets Rajinikanth on Chennai visit
Decoding Malaysian PM's 6-day visit to India
An all-India express highway, thanks to Malaysia