Bakhtiar invited Khomeini back to Iran, with the intention of creating a Vatican-like state in the holy city of Qom, declaring that "We will soon have the honor of welcoming home the Ayatollah Khomeini". On 1 February 1979 Khomeini returned to Tehran in a chartered Air France Boeing 747. The welcoming crowd of several million Iranians was so large he was forced to take a helicopter after the car taking him from the airport was overwhelmed by an enthusiastic welcoming crowd.
On the day of his arrival Khomeini made clear his rejection of Bakhtiar's government in a speech promising, "I shall kick their teeth in. I appoint the government, I appoint the government in support of this nation". On 5 February at Khomeini's headquarters in the Refah School in southern Tehran, he declared a provisional revolutionary government, appointed opposition leader Mehdi Bazargan (from the religious-nationalist Freedom Movement, affiliated with the National Front) as his own prime minister, and commanded Iranians to obey Bazargan as a religious duty.
On 9 February, a rebellion of pro-Khomeini air force technicians broke out at the Doshan Tappeh Air Base. A unit of the pro-Shah Immortal Guards attempted to apprehend the rebels, and an armed battle broke out. Soon large crowds took to the streets, building barricades and supporting the rebels, while Islamic-Marxist guerillas with their weapons joined in support.
On 11 February, Khomeini appointed his own competing interim prime minister, Mehdi Bazargan, demanding, "since I have appointed him, he must be obeyed." It was "God's government," he warned, disobedience against him or Bazargan was considered a "revolt against God".
The final collapse of the provisional non-Islamist government came at 2 pm 11 February when the Supreme Military Council declared itself "neutral in the current political disputes... in order to prevent further disorder and bloodshed." All military personnel were ordered back to their bases, effectively yielding control of the entire country to Khomeini. Revolutionaries took over government buildings, TV and radio stations, and palaces of the Pahlavi dynasty, marking the end of the monarchy in Iran. Bakhtiar escaped the palace under a hail of bullets, fleeing Iran in disguise.
On 30 and 31 March (Farvardin 10, 11) a referendum was held over whether to replace the monarchy with an "Islamic republic". Khomeini called for a massive turnout and only the National Democratic Front, Fadayan, and several Kurdish parties opposed the vote. The results showed that 98.2% had voted in favor of the Islamic Republic.
The Revolutionary Guard, or Pasdaran-e Enqelab, was established by Khomeini on 5 May 1979, as a counterweight both to the armed groups of the left, and to the Shah's military. The guard eventually grew into "a full-scale" military force,becoming "the strongest institution of the revolution."
On 22 October 1979, the United States admitted the exiled and ailing Shah into the country for cancer treatment. In Iran, there was an immediate outcry, with both Khomeini and leftist groups demanding the Shah's return to Iran for trial and execution.
On 4 November 1979 youthful Islamists, calling themselves Muslim Student Followers of the Imam's Line, invaded the US embassy compound in Tehran and seized its staff. Revolutionaries were angry because of how the Shah had fled abroad while the Embassy-based American CIA and British intelligence organized a coup d'état to overthrow his nationalist opponent who was a legitimately elected official. The students held 52 American diplomats hostage for 444 days, which played a role in helping to pass the constitution, suppressing moderates, and otherwise radicalising the revolution.
On 4 November, a group of Iranian college students calling themselves the Muslim Student Followers of the Imam's Line, took control of the American Embassy in Tehran, holding 52 embassy staff hostage for 444 days – an event known as the Iran hostage crisis.
The provisional government fell shortly after American Embassy officials were taken hostage on 4 November 1979. Bazargan's resignation was received by Khomeini without complaint, saying "Mr. Bazargan ... was a little tired and preferred to stay on the sidelines for a while." Khomeini later described his appointment of Bazargan as a "mistake."
On November 4, 1979, a group of Iranian students took over the U.S. Embassy in Tehran. The students belonged to the Muslim Student Followers of the Imam's Line and were in support of the Iranian Revolution.