TEHRAN, Iran - Powerful reformists and conservatives within Iran's elite have joined forces to wage an unprecedented behind-the-scenes campaign to unseat President Mahmoud Ahmadinejad, worried that he is driving the nation to the brink of collapse with populist economic policies and a confrontational stance toward the West.

The prominent figures have put their considerable efforts behind the candidacy of reformist Mir Hossein Mousavi, who they believe has the best chance to defeat the hard-line Ahmadinejad in Friday's presidential election and chart a new course for the country.

They have used the levers of government to foil attempts by Ahmadinejad to secure funds for populist giveaways and to permit freewheeling campaigning that has benefited Mousavi. State-controlled television agreed to an unheard-of series of live debates, and the Council of Guardians, which thwarted the reformist wave of the late 1990s, rejected a ballot-box maneuver by the president that some saw as a prelude to attempted fraud.

Some called it a realignment of Iranian domestic politics from its longtime rift between reformists and conservatives to one that pits pragmatists on both sides against radicals such as Ahmadinejad.

"Some of the supporters of Mousavi like his ideas; others don't want Ahmadinejad," said Javad Etaat, a professor of political science and a campaigner for Mousavi. "They've decided that preserving the nation is more important than preserving the government."

Those involved in the effort say they already have outmaneuvered Ahmadinejad and his allies, including Ayatollah Ali Khamenei, the supreme leader, and gained the upper hand within Iranian institutions and among voters. Most analysts say Khamenei, who has stressed that he has only one vote in the elections, is quietly supporting Ahmadinejad, although he is also concerned with public sentiment and trying to appear above the competition.

Several pro-Ahmadinejad lawmakers have discounted the effort against him, citing internal poll numbers that they claim show the president will be reelected easily despite the front arrayed against him.

In addition to protecting their own considerable financial and political interests, which include control over key segments of foreign trade, private education and agriculture, Ahmadinejad's behind-the-scenes opponents fear that a win by the incumbent will further isolate Iran internationally, weaken the middle class, and give more power to the military and the Revolutionary Guard.

"We can't run Iran like North Korea," said Saeed Laylaz, a newspaper editor and analyst with contacts among the political elite. "A group of militarists cannot stuff this civilization into a can and put it away. Iran cannot make up for its lack of economic might with nuclear technology, missiles, and proxy threats in Lebanon and Palestine and elsewhere."

The behind-the-scenes maneuvering is an illustration of how power works within Iran's complicated and fractured circle of politics. But it also shows how much division Ahmadinejad has sown within the ruling establishment, where he is a lightning rod of anger and resentment by formidable political heavyweights among both moderates and conservatives.

The effort is emerging from deep within the Iranian state and includes some of the most prominent conservative names, including Ali Akbar Nateq-Nuri and Ali Akbar Velayati, both close to Khamenei, Iran's highest political and military authority. But if there's a brain behind the push against Ahmadinejad, it's Ali Akbar Hashemi Rafsanjani, Iran's longtime kingmaker.

Several political insiders close to his camp said that Rafsanjani brokered a deal with Khamenei several months ago in which he would encourage moderate former president Mohammad Khatami to drop out of the race in exchange for the supreme leader's refraining from tilting the table in Ahmadinejad's favor during the electoral campaign.

Ahmadinejad himself publicly accused Rafsanjani of organizing the effort against him. Rafsanjani's supporters proudly admit working against the president.

But aside from Rafsanjani, many others in the Iranian establishment took action to thwart the president's bid for a second term.

Ali Larijani, the conservative parliament speaker who hails from a famous clerical family, foiled Ahmadinejad's plan for handouts, which many critics see as a squandering of the country's oil wealth as well as an attempt to bribe voters.

Ahmadinejad has curried favor with the pious poor by doling out billions in low-interest loans to young married couples and small entrepreneurs as well as "justice" shares of state firms going public. Critics say the giveaways increase inflation and are politically targeted handouts of resources better devoted to improving infrastructure and creating jobs.