According to security officials and opposition figures, he made several moves to retain power in the days and hours before the no-confidence vote. However, he failed to stop it and in the last minutes before midnight on Saturday, he was fired. Khan had initially tried to block the vote, which was first scheduled to be heard in the National Assembly last weekend, dissolving parliament and calling for new elections, arguing the vote was part of a “foreign conspiracy” to overthrow him. But that maneuver was overturned by the Supreme Court, which ruled that Khan’s actions violated the constitution and ordered the vote to take place on Saturday. On Friday, a senior minister from his ruling government sent a message to an opposition leader that read: “Martial law or elections – your choice.” He seemed to be threatening the opposition with the ultimatum that they should agree to Khan’s demand for new elections, otherwise he would bring the powerful Pakistani army to take control, as has happened repeatedly in the country’s history. An opposition figure said he had refused the request. “Imran Khan thought it should be him or someone,” they said. According to security officials, on the day of the no-confidence vote, which was delayed by 14 hours by Hahn’s party, the prime minister had tried to oust the army chief to challenge the army to take control and impose martial law. “Imran Khan wanted to fire the army chief, but the forces received information about it and thwarted his plan after learning of it,” said a security official who spoke on condition of anonymity. “Khan wanted to create a huge crisis to stay in power.” Khan’s ministers also appeared to be preparing the ground for military intervention. “If martial law is imposed in the country, opposition parties will be responsible for it, as they have been involved in vote-buying,” then-Information Minister Fawad Chaudhry told reporters on Saturday. As the impeachment vote continued to be obstructed and delayed by Assad Caesar, the speaker of parliament and a close ally of Khan, who reportedly acted on his direct instructions, opposition leader Bivalal Bhutto Zardari told parliament: “Imran O Khan wants the army to be involved.” The chief justice also took unprecedented action by ordering the supreme court to open its doors at midnight, to act in the event that Khan attempted to prevent a vote authorized by law. Allegations that Khan was trying to “oust the army chief of staff for promoting political interests” also referred to a legal report filed by lawyer Adnan Iqbal in the Islamabad Supreme Court on Saturday night. While Khan’s rise to power seemed to have the backing of Pakistan’s powerful armed forces, in recent months there has been an increasingly apparent rift between him and the military establishment over a senior military appointment. It seems that the friction between Khan and the army came to an end on Saturday night. Khan met with General Qamar Javed Bajwa, the army’s chief of staff, that night after trying to oust him earlier that day, according to Reuters. Local media reported that Bajwa told Khan to accept his fate and stop interfering in the vote. Finally, after the speaker resigned dramatically and just a few minutes before the deadline at midnight, the vote took place in the National Assembly. Khan, who no longer had a parliamentary majority, lost by 174 votes, making him the first Pakistani prime minister to step down in a vote of no confidence. The military, which has long denied interfering in Pakistan’s politics, has denied the allegations in a statement issued Friday stating “Similar, baseless allegations concerning Pakistan’s foreign policy have been made more than once. Chaudry, Khan’s former intelligence minister, also denied Khan’s attempts to usurp the vote. “These false stories are being spread to mislead the public and create anarchy in the country. “All these malicious attempts will be defeated by the people of Pakistan,” said an official close to the army. “Pakistan’s armed forces are the guarantor of peace in Pakistan and the enemy is trying to tarnish the image of the armed forces.” On Monday, Sabah Sharif, the leader of the opposition coalition and brother of jailed former Prime Minister Nawaz Sharif, will be sworn in as prime minister. It is expected to call elections in due course, which will most likely take place after October. In his first comments since losing the vote, Khan reiterated his claim that he had been the victim of a foreign conspiracy. “Pakistan became an independent state in 1947, but the struggle for freedom is starting again today against a foreign regime conspiracy. “It’s always the people of the country who are defending their sovereignty and democracy,” he wrote on Twitter. On Sunday night, huge crowds took to the streets of Islamabad and Karachi to protest Khan’s ouster. All members of Khan’s Pakistan Tehreek-e-Insaf party also announced on Sunday that they would resign en masse from the National Assembly, a process that is likely to take several months.