Malaysian Prime Minister Mahathir Mohamad today fired his deputy and heir-apparent, Anwar Ibrahim, one day after imposing strict new currency controls and other measures that contradict Anwar's traditional free-market remedies for the country's ailing economy.

The sacking of the popular Anwar, who was also finance minister for the last seven years, marks the last step in Mahathir's high-risk effort to jettison Western economic orthodoxy in favor of a go-it-alone approach aimed at ending Malaysia's financial collapse.

The removal of Anwar -- his handpicked heir who had emerged as a rival -- now leaves Mahathir, 72, more firmly in control of Malaysia's politics than at any time in his 17-year tenure. When President Suharto fell in Indonesia last May, many in the region were speculating that Mahathir, now Southeast Asia's longest-serving leader, might become the next political casualty of the region's economic crisis and that Anwar, 51, affable and respected in Western financial circles, would replace him.

But Anwar's dismissal seemed likely today to further rattle Malaysia's financial markets, which went into a tailspin when Mahathir announced tough new rules this week to limit short-term stock trading and to withdraw the local currency, the ringgit, from international circulation in a dramatic move to shield the country of 22 million from the whims of the global marketplace.

Anwar's removal was announced in a statement issued after the markets closed. It gave no reason for the dismissal.

For days, however, speculation had been rife in the capital, Kuala Lumpur, that Anwar was on the way out because of the deepening split with Mahathir over economic policy. Last Friday, the central bank governor, an Anwar ally, resigned along with a deputy, partly because of opposition to Mahathir's plans to impose currency controls.

And while Anwar continued to serve as finance minister, his power had essentially been cut since June when Mahathir appointed Daim Zainuddin as a special economics czar in overall charge of economic policy. Daim, a former finance minister, reversed most of Anwar's policies, which were based largely on the tight-money prescription recommended by the International Monetary Fund.

Mahathir may have been prompted to move firmly against his deputy because of suspicions that Anwar was plotting over the summer to unseat Mahathir at a congress of the ruling United Malays National Organization.

At the party meeting in June, Anwar's supporters had planned a sneak attack on the prime minister, hitting him in the area where he is considered most vulnerable: corruption. But Mahathir fired back, reading from a prepared list the names of all ruling-party members who had benefited from government contracts. The list included some of Anwar's relatives. The corruption talk was quickly shelved.

With the internal rebellion quelled and the delegates in line, Mahathir proceeded to rein in his deputy on several fronts, moving first against suspected backers of Anwar in the press and then the Central Bank.

As the Mahathir-Anwar rivalry played out, a climate of fear took hold in Kuala Lumpur. One of Anwar's friends was arrested under the security act for having pistol ammunition, a crime that carries the death penalty. Other aides and supporters are lying low. Anwar's enemies also have targeted him in a hate campaign.

Today's firing marks a dramatic reversal of fortune for the men, a generation apart, whose odd minuet has dominated Malaysian politics for more than a decade.

When Asia's economic crisis erupted last year, Mahathir's impolitic outbursts -- blaming currency speculators, the foreign media, even an amorphous Jewish conspiracy -- seemed to hasten the down-slide. And it was Anwar who appeared as the voice of reason, following IMF prescriptions (but not taking IMF money) and generally correcting his boss' statements. Anwar made the cover of the Asian edition of Time magazine as a new breed of Asian leader, Western in outlook and more interested in democracy and human rights.

Many people were asking -- prematurely it turns out -- how long before Mahathir would follow his friend Suharto in being forced from power.

Analysts attribute the turnaround in Mahathir's fortunes to his political acumen, combined with a tough and combative streak. Unlike Suharto, who at 76 was seen as aloof and out of touch, Mahathir remains a deft tactician. "He is a masterful politician," a Western diplomat said. "He is feared. And I would say he is popular. It's hard for people to imagine anything else."

Now it appears the comparisons to Indonesia were superficial at best. For one thing, although Malaysia's economy is now officially in recession -- contracting nearly 7 percent in the second quarter of this year -- the fall is nowhere near the catastrophic collapse in Indonesia.

Also, the media here are still tightly controlled, unlike in Indonesia, where, during the last months of Suharto's rule, newspapers and magazines regularly carried articles and commentaries critical of the regime and gave an outlet to opposition leaders.

Another key difference is that while the United Malays National Organization has held undisputed power in Malaysia for decades, it does not have a majority in the parliament. It has 89 of 192 seats and rules in a coalition with a Chinese party and an Indian party. The coalition was created to accommodate the country's potentially volatile ethnic mix. But a diplomat who has analyzed the structure says it has kept power carefully balanced.

"There's real interest-group horse-trading," he said. "And everybody gets something out of it." CAPTION: MALAYSIA'S ECONOMIC MEDICINE (This chart was not available) CAPTION: Anwar Ibrahim, fired by Prime Minister Mohamad, waves from his car. FO CAPTION: Kuala Lumpur money changers count ringgits, which have been withdrawn from international circulation.