CAIRO — There was a time when Iranian President Mahmoud Ahmadinejad used his annual trip to the United Nations for two big objectives: Basking in the attention of America's media hub and personally delivering the views of the Islamic Republic to Western leaders. The spotlight seeking is still there. But what's missing this year is any sense that Ahmadinejad is still a trusted messenger for the ruling clerics after trying to expand the limits of his power and being batted down harshly. "He's damaged," said Ahmad Bakhshayesh, a political affairs professor at Tehran's Azad University. Dubai-based analyst Theodore Karasik sees "a badly wounded lame duck" arriving in New York for the U.N. General Assembly session that begins Tuesday. There's little doubt about Iran's political pecking order these days: Ahmadinejad and his allies are sharply diminished while the theocracy and its protectors — including the hugely powerful Revolutionary Guard — are grinding away at any opposition. This suggests Ahmadinejad's voice may be as booming as ever at the U.N. — and in possible side trips around New York — but his role as an emissary of Iran's ruling system is severely muted. It adds to the increasing difficulties for Western officials to interpret Iran's moves with international talks stalled over Tehran's nuclear program and key Middle East ally Bashar Assad in Syria locked in a battle for survival against Arab Spring protesters. The crosscurrent messages were on full display this week over possible negotiations to free two Americans jailed in Tehran as spies. Ahmadinejad said a bail-for-freedom deal could be on the fast track. But Iran's judiciary — directly controlled by Supreme Leader Ayatollah Ali Khamenei — quickly slapped him down with a blunt reminder that only the courts have the authority to set a timetable on a possible release. By the recent standards of Iran's infighting, Ahmadinejad got off easy. Dozens of Ahmadinejad's political backers have been arrested or hounded out of the public eye by hard-line forces in recent months. His protégé and top aide, Esfandiar Rahim Mashaei, has been effectively blackballed from his goal of succeeding Ahmadinejad in 2013 elections by a series of reputation-killing accusations. They include leading a "deviant current" that seeks to challenge the system of theocratic rule, and alleged links to a $2.6 billion bank fraud probe described as the biggest financial corruption scam in Iran's history. Some critics have even accused Mashaei of using "black magic" spells to cloud Ahmadinejad's mind. In June, Ahmadinejad railed against his opponents — and Khamenei by extension — for launching a "politically motivated" campaign, and he vowed to stand by Mashaei, whose daughter is married to the president's son. "Ahmadinejad will be going to the U.N. weaker and more isolated at home than any other time" since taking office in 2005, said Meir Javedanfar, an Israel-based analyst and co-author of an Ahmadinejad biography "The Nuclear Sphinx of Tehran." It wasn't too long ago that Ahmadinejad was seen as a favored son of Iran's hierarchy. Khamenei stood by the president's side after his disputed re-election in June 2009 and kept up the show of unity as security forces systematically crushed the opposition protests and put a ring of silence around its leaders, who are believed to be under round-the-clock watch. Cracks began to show as the political comfort level grew after the unrest ebbed. Ahmadinejad cautiously tried to nudge the boundaries of his office into the exclusive territory of the ruling clerics, who oversee all important policies, appointments and programs — including nuclear and missile development. The sharp message back to Ahmadinejad: Stick to your own affairs that mostly occupy domestic issues and promoting the leadership's stances around the world. The real fireworks came in April when Ahmadinejad apparently forced the resignation of the influential Intelligence Minister Haidar Moslehi. Khamenei tossed it all back, reinstating Moslehi and prompting a 10-day tantrum by Ahmadinejad, who stayed away from Cabinet meetings and other duties. "Over the past year, he occasionally appeared like a spokesman for the opposition," said Sasan Golestan, a columnist for several Iranian newspapers. Ahmadinejad eventually made conciliatory statements to Khamenei and his inner circle. But it also would seem that Ahmadinejad promised a change of public tone along with the contrition. Much of his old bombast has been replaced by more subdued atmospherics — appearing at times more professorial than the firebrand who once called for Israel to be wiped off the map. There were even plaintive moments in an interview with NBC earlier this week. "Why the American leaders are so hostile against us?" he said in comments Tuesday on the "Today" show. Shortly after Ahmadinejad returns to Iran from New York, the country will shift into election mode for parliamentary balloting in March. The vote will be a clear test for Ahmadinejad's final year in office. Forces loyal to Khamenei have already set up political committees whose goal is to steamroll Ahmadinejad's allies. But some believe Ahmadinejad's political skills are being underestimated. "He learned from the showdown (with Khamenei) ... it's too early to say he is finished," said Sadegh Zibakalam, a Tehran University political science professor. Zibakalam notes that Ahmadinejad's political machine remains strong in his base in Iran's hinterlands among low-income families, who lavishly praise his government's anti-poverty handouts. "Ahmadinejad's opponents become worried when he visits the provinces. But they grow even more concerned when he's at the U.N.," said Reza Mahmoudi, a mechanical engineer who has voted for Ahmadinejad in two elections. "It's a chance for him to talk to the world." ___ Associated Press writer Nasser Karimi in Tehran, Iran, contributed to this report.