Mahathir, Malaysia's longest-serving premier who defected to the opposition to take on Najib, will return to power at the age of 92. His four-party Pakatan Harapan alliance won at least 112 of 222 parliamentary seats in Wednesday's vote, official figures from the election commission showed.
"We are not seeking revenge," Mahathir said. "What we want to do is to restore the rule of law."
Khairy Jamaluddin, a member of Najib's Cabinet, said the prime minister plans to hold a press conference on Thursday.
The result represents a monumental shift in a nation long defined by racial politics that hasn't seen a transfer of power since independence in 1957. It's also a win for democracy in Southeast Asia, where generals and authoritarian leaders often lock up opponents and stifle free speech.
"It's a new beginning for Malaysia," said Ahmad Martadha Mohamed, an associate professor at Universiti Utara Malaysia College of Law.
The outcome may be bad news for investors who had bet on a Najib victory, sending the benchmark FTSE Bursa Malaysia KLCI Index near a record high on the eve of the election. As results signaled a win for Mahathir, iShares MSCI Malaysia ETF based on the nation's stocks dropped as much as 2.6 percent to the lowest since February.
Markets are expected to be closed Thursday and Friday after the government declared public holidays. Malaysia's police advised political parties to not hold rallies that could jeopardize public order.
Mahathir on Wednesday implored government officials to "do what is right according to the constitution and the laws of this country." He had previously run the country from 1981 to 2003, and wielded power even after he stepped down.
The vote showed that Mahathir still knows how to win elections. The victory was dominant: He swept traditional government strongholds like Johor, Kedah and Negeri Sembilan and neutralized Najib's advantage in the Borneo states of Sabah and Sarawak.
What's more, Mahathir appeared to decisively win over ethnic Malay voters that had long underpinned the ruling party's success. The mostly ethnic Chinese Democratic Action Party, previously the largest opposition party, was on pace to win fewer seats than in 2013.
For Mahathir, the fight against his former protege was particularly ugly. The two fell out over a myriad policy issues, including Najib's decision to abolish the Internal Security Act, his performance in the 2013 general election and a money laundering scandal involving state investment firm 1MDB. Najib has denied wrongdoing.
On the campaign trail, the opposition mainly focused on bread-and-butter issues. Najib faced rising discontent over a goods-and-services tax that helped inflation accelerate last year at nearly the fastest pace in a decade.
What comes next is unclear. Mahathir helms an unwieldy four-party coalition that includes Malaysia's largest ethnic Chinese party, and he plans to step aside once de facto opposition leader Anwar Ibrahim gets out of jail on a sodomy charge. Mahathir said he would seek a pardon for Anwar.
"I have to manage four presidents of four different parties," Mahathir said. "It's going to be a headache."
Mahathir has pledged to set term limits for prime minister and reduce its power, while promising to scrap the GST within 100 days in power.
It's uncertain whether the outcome will fundamentally reshape race relations in Malaysia. Najib's party had long staked its legitimacy on providing preferential treatment for the bumiputera, or "sons of the soil," which include ethnic Malays and indigenous groups.
Mak Hon Hoe, a 46-year-old ethnic Chinese voter, on Wednesday deplored the fact that Malaysians were separated in different racial categories.
"I want to see a fairer system," he said while casting his ballot. "Race is still an issue. We want a Malaysian identity."
Bloomberg's Chong Pooi Koon and Yudith Ho contributed.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.