The expansion by the Islamic State (IS) group across Iraq last summer caused consternation in neighbouring Iran. Iranian state media sought to play down the threat, reassuring the public that the Iraqi military was countering the militant group. In reality, the government and its paramilitary forces, the Revolutionary Guards, saw IS as a grave and growing threat in Iran's backyard. Fast forward several months and the militants control huge amounts of territory in Iraq. But Iran is in a different position. It is no longer trying to downplay IS's presence on its doorstep. Instead, Tehran has transformed the challenge into an opportunity, by meeting Baghdad's need for ground assistance in the fight against IS while simultaneously cementing its influence and control over its neighbour. No one seems to have done this more effectively than Qassem Soleimani, commander of the Revolutionary Guards' elite Al-Quds Force. Soleimani has carried out an extensive PR campaign: photographs of him posing with everyone from Iraqi fighters to members of the Kurdish, Sunni and Shiite communities would make for a long Tumblr page. The campaign aims to reassure Iranians that their government has everything under control and that the instability in Iraq does not threaten their own security. Iraq's stability is an important concern for Iranians, many of whom remember the devastating Iran-Iraq War in the 1980s. For many, the war confirmed that Iran could not count on anyone but itself to ensure the security of its borders. The campaign also aims to deter IS by showing that top Iranian commanders and elite forces are present in Iraq and, given the limits of Western intervention, are prepared to use whatever means necessary to counter the threat. IS cannot be defeated with air strikes alone, and these are all the West seems prepared to do. The coalition needs local support, and it needs to be prepared to send in large numbers of ground forces for a long time. Only Iran is both able and willing to do that. Soleimani's campaign also serves another purpose: to show the US-led international coalition that Tehran is on top of things. Iran has weapons and intelligence. Most importantly, it has boots on the ground. Its forces know Iraq and Iraqis of all backgrounds better than the West does. Soleimani's campaign demonstrates that Iran does not need an international coalition to secure its neighbourhood. The West, on the other hand, needs Iran if it wants to “degrade and ultimately destroy” IS, as US President Barack Obama puts it. While Iran was dumbfounded last summer by the speed of IS's gains in Iraq and Baghdad's inability to respond effectively, it now appears to be on top of the situation, using the conflict to showcase its power. Iran has suffered minimal casualties in Iraq, and the threat is largely under control. In exchange, Iran has received the gratitude of the Iraqi people, many of whom feel they owe their security in part to the Islamic Republic. The president of the Iraqi Kurdistan Region, Masoud Barzani, has said that Tehran was the first country to supply weapons to his men when the conflict with IS broke out. This was at a time when the West was still debating what to do to tackle IS. Iran now sends two to three military aircraft a day filled with weapons and ammunition to Baghdad. The assistance, worth $10 million over the past year, was recently confirmed by former Iraqi Shiite militia leader Jamal Jaafar. Soleimani and his men have rallied Shiite militias in the fight against IS, significantly bolstering their numbers. Following the early failure of Iraqi security forces to stop the spread of the militant group, Iran helped organise the forces. This included integration of the expanded Shiite militias. As a result, Iranian influence in Iraq is high today. But it carries a risk. If Iran pushes the Shiite agenda too hard it risks further splitting Iraq, which it wants to avoid. This is why Tehran was initially reluctant to publicise its presence in Iraq. The conflict is already viewed as a sectarian one, and significant Iranian involvement would only add fuel to the fire. But Iran has had to balance the costs of becoming embroiled in a sectarian conflict with the need to contain IS. International efforts to weaken the group, as well as Tehran's own operations, have helped the situation. As a result, Iran does not feel the need to hide its presence in Iraq. But it engages in a way that highlights its cooperation with all three major stakeholders: Kurdish, Shiite and Sunni. The last few months have shown that Tehran is able to quickly adapt its strategy to respond effectively to threats. After some initial hesitation, Iran was the only country willing to devote ground forces in Iraq, in addition to assistance and air strikes. This effectively secures Iranian influence in the country. As a result, today the international coalition can no longer ignore Tehran in its fight against IS. Dina Esfandiaryis a MacArthur Fellow at the Centre for Science and Security Studies, King's College London. Ariane Tabatabaiis a visiting professor at the Georgetown University School of Foreign Service's Security Studies Programme.