IN THE higher echelons of the Islamic Republic, people may be losing patience with President Mahmoud Ahmadinejad. Informed Iranians do not think he risks losing his job. But plainly he is not as safe as he was. Conservatives in Iran's parliament and press blame his extravagance at home and braggadoccio abroad for Iran's worsening economic malaise and for the unpleasant sense of being ever more squarely in the Americans' firing line.

In recent weeks, the United States has twice seized Iranians in Iraq, sent another aircraft-carrier into the Persian Gulf and armed Iran's Arab neighbours with Patriot missiles. Such moves have been accompanied by a barrage of verbal attacks from top Americans, including the president and his secretaries of state and defence.

Already cock-a-hoop over the defeat of Mr Ahmadinejad's allies in local elections last month, his domestic critics are keen to blame him for the latest round of American sabre-rattling as well as for last month's sanctions resolution passed against Iran in the UN Security Council. It seems that a clutch of senior figures in the regime, perhaps including the supreme leader, Ayatollah Ali Khamenei, have endorsed the criticism.

“Just when the nuclear issue was about to move away from the UN Security Council, the president's fiery speeches have resulted in the adoption of two resolutions,” said Hamshahri, a popular newspaper in Tehran, the capital. Such comments mark a departure from last year, when it was deemed unwise to challenge the government's performance on the nuclear issue.

Mr Ahmadinejad's anti-American bluster has also been attacked in light of his recent visit to Latin America, widely viewed as ill-timed and unnecessary. A reformist daily, Etemaad-e Melli, called the Venezuelan, Ecuadorean and Nicaraguan presidents, who embraced Iran's president, “left-wing friends, good for coffee-shop discussions but not for setting our security, political and economic priorities”.

During the trip, Mr Ahmadinejad announced he would put $1 billion into an Iranian-Venezuelan fund to help countries “free themselves from the yoke of American imperialism”. That sharpened the more serious criticisms he faces at home over Iran's economic performance.

A recent statement signed by 150 members of parliament imposed conditions on the president in drawing up the budget for the next Iranian year, which starts in late March. The MPs are now calling on him to defend his record before parliament.

It would not be Mr Ahmadinejad's first run-in with deputies who supposedly share many of his own convictions. In late 2005, conservative MPs caused a crisis by rejecting several of the president's nominees for oil minister, the cabinet's most important post. They have since repeatedly questioned his off-the-cuff economic style, which pleases the masses but is disliked by most economists.

A sudden decision last year to raise the minimum wage had to be reversed when it caused job losses and strikes across the country. On his weekly trips to the provinces, the president is in the habit of dishing out government largesse to petitioners for local causes. And parliament has accused the government of favouritism in giving big contracts to the Revolutionary Guards without going to tender.

This lavish and sometimes whimsical spending has pushed up inflation and made Iran more vulnerable to oil-price fluctuations. MPs are increasingly concerned, not least because they face re-election early next year and fear they will be blamed for the country's economic woes.

The president seems to thrive on controversy. But he may be in for an unusually rough few months. Taking his cue from the supreme leader, Mr Ahmadinejad may be well advised to dampen his oratory and submit a prudent budget to parliament. But that is not his usual style.