Iranian President Mahmoud Ahmadinejad fired his intelligence minister and his culture minister resigned under pressure Sunday as further rifts emerged in his camp with just days to go until his controversial inauguration for a second term. Although Ahmadinejad has frequently replaced his cabinet members over the past four years, Sunday's firing and resignation were significant because both Intelligence Minister Gholam-Hossein Mohseni-Ejei and Culture Minister Mohammad Hossein Saffar Harandi are especially close to Iran's supreme leader, Ayatollah Ali Khamenei, analysts say. 'All ministers are close to him,' said Amir Mohebbian, a political analyst who shares Ahmadinejad's ideology but has been critical of his actions. 'But these two are closer to the leader.' Taken together, the moves suggest deep unhappiness within Ahmadinejad's inner circle at a time when the government is still reeling from the impact of a weeks-long campaign by the opposition to overturn the results of June's disputed election, in which Ahmadinejad was declared the winner in a landslide. While Khamenei openly supported Ahmadinejad in the weeks after the disputed election and the two were tightly aligned with one another during the protests and the subsequent crackdown, some divisions between the men have emerged in recent days. Sunday's cabinet firing and resignation came just a day after Ahmadinejad was criticized by both the head of the armed forces and an influential ally in parliament for his delay in complying with an order from Khamenei to drop his pick for vice president. Ahmadinejad withdrew Esfandiar Rahim Mashai's name for the position Saturday, a full week after the supreme leader's order. Ahmadinejad subsequently gave Mashai an influential gatekeeper position as head of his presidential office. The timing of Sunday's departures from the cabinet appeared to be related to Ahmadinejad's decision on Mashai -- both ministers sided with the supreme leader in believing Mashai was not fit for office. Mashai faced criticism last year from Khamenei for saying that Iran was friendly with people of all nations, including those of archenemy Israel. Mohebbian, the analyst, said the president felt weakened over the forced dismissal of Mashai, and reacted Sunday by forcing out the two cabinet members. 'Ahmadinejad is now trying to counter this and wants to show himself as a strong leader,' he said. 'However, such actions will deal a heavy blow to his position among his supporters.' In another move bound to anger critics, Ahmadinejad appointed the highly controversial Ali Kordan as special inspector Sunday, according to the Mehr news agency. Last year, Kordan was impeached as interior minister after his Oxford law degree turned out to be fake. In his new job, Kordan will investigate cases of corruption and fraud within the government. The two departures from the cabinet on Sunday mean that 12 out of Ahmadinejad's original 21 cabinet members have either resigned or been fired since 2005. Under the constitution, Ahmadinejad is required to submit his cabinet to a new vote of confidence from the parliament if he has replaced more than half its members. That is unlikely to happen, however, because Ahmadinejad is being sworn in for a second term Aug. 5, and he will have to submit a new cabinet for confirmation by Aug. 28. In the meantime, Iranian political observers say Ahmadinejad's government will have trouble functioning. The deputy head of the parliament, Mohammad Reza Bahonar, told Mehr that any cabinet meeting would be illegal until the new cabinet is sworn in. The culture minister's resignation came hours after reports, widely carried by state media but later denied, that Ahmadinejad had fired him. In a statement, he acknowledged Ahmadinejad had tried to force him out. Members of Iran's opposition expressed indifference to the cabinet moves because they deem the government illegitimate. Morteza Alviri, an aide to defeated candidate Mehdi Karroubi, said the upheaval over Ahmadinejad's cabinet was a plot to divert attention from the disputed election result. 'In order to mask the main point, which is the illegal election result, spectacular side events are created to make people's minds busy,' Alviri said in an interview. Demonstrators faced off with police Sunday after they gathered near the entrance of a mosque in Tehran, witnesses reported. The demonstrators were trying to attend a service in honor of Mohsen Ruholamini, who died in prison after participating in recent protests, but the service was cancelled at the last minute. 