Bosnia and Herzegovina gained their first points at a FIFA World Cup and in the process ended Iran's hopes of qualifying for the last 16.
Beaten narrowly by Argentina and Nigeria in their first two Group F fixtures, Safet Sušić's debutants got off the mark at the third attempt. Reza Ghoochanneijhad's 82nd-minute goal – Iran's first of the finals – offered hope after Edin Džeko and Miralem Pjanić had given Bosnia and Herzegovina a cushion, but right-back Avdija Vršajević swiftly sealed a historic victory for the Dragons.
Džeko had eight unsuccessful efforts on goal last time out against Nigeria and was again to the fore early on in Salvador. The Manchester City FC striker had forced Alireza Haghighi to tip over his stinging fourth-minute shot and headed into the keeper's hands before putting Bosnia and Herzegovina in front.
Iran had set up like they had against Nigeria and Argentina – content to cede ground with a view to hitting their opponents on the break – but their game plan unravelled when Džeko struck midway through the half with a precise low shot in off Haghighi's left-hand upright from outside the penalty area.
Carlos Queiróz's team responded well, almost equalising within two minutes. Only the underside of the crossbar prevented Iran from breaking their scoring duck, Masoud Shojaei floating an attempt over Asmir Begović after being found in space inside the box.
The Middle Eastern side emerged after half-time with renewed purpose, but that touch of quality in the final third continued to elude them. Just before the hour the Bosnians incisively showed them how it should be done, ruthlessly punishing Jalal Hosseini's mistake.
The defender presented possession to Džeko, who in turn found Tino-Sven Sušić. His ball was slid into the path of Pjanić for a neat finish across Haghighi. Ghoochanneijhad halved Iran's arrears with eight minutes left, turning in Javad Nekunam's ball across goal, only for Vršajević to put the outcome beyond doubt on the counterattack.