However, almost immediately Avdija Vrsajevic went up the other end to kill Iran's hopes of qualification.
Here, Sports Mole casts a meticulous eye over the performances of both sides.
On target: 5
On target: 2
Was the result fair?
In a word, yes. Bosnia looked a lot more potent going forward, and while both sides were fairly evenly matched in midfield, it was the final third that separated both sides. Edin Dzeko kicked things off with a wonderful strike, before Iran were well and truly carved open for Miralem Pjanic's effort, and again on the counter-attack for Avdija Vrsajevic's goal.
Bosnia deserved the win and can perhaps count themselves unlucky to be going home. It was the Nigeria result that has proved their downfall, but here they were fluent at times in the final third. The game was quiet in parts, but the European side offered the greater threat.
Once again, Iran failed to muster anything by way of clear-cut chances, apart from Reza Ghoochannejad's tap-in late on. Ashkan Dejagah will emerge with credit. The Fulham midfielder worked hard throughout before he was substituted.
Sports Mole's man of the match
Miralem Pjanic: The Roma man deserved his goal and was a cut above in midfield. He took his goal really well and showed his class with some clever passes, while always looking to begin attacks for his side.
Iran showed unwillingness to throw caution to the wind in the final third, even when they went a goal down. They carried on playing the same way and were devoid of creativity or intensity as their World Cup campaign ended with a whimper.
Carlos Velasco Carballo didn't have much to do. He handed out a booking each for either side, and there was not much to cause the referee too much trouble this afternoon.
Bosnia: Safet Susic's side exit the World Cup and the coach looks as though he will step down from his position.
Iran: Likewise for Iran, as Carlos Queiroz has coached his last match in charge of the side.