Iraq will play the United Arab Emirates in the final of the Gulf Cup after two thrilling semi-finals on Tuesday.
Iraq shattered hosts Bahrain's hopes of a maiden Gulf Cup title with a dramatic 4-2 victory in a penalty shootout after extra time ended 1-1.
And Ahmad Khalil was the Emirati hero as he scored a last-gasp goal to guide his team to a 1-0 victory over defending champions Kuwait.
The hero for Iraq was goalkeeper Noor Sabri, who not only saved two shots in the penalty shootout but also converted the winning spot kick to trigger wild celebrations among a large expatriate Iraqi crowd at the National Stadium in Riffa.
In the penalty shootout, Sabri saved penalties from Bahrain captain Mohammed Hussain and Abdulwahab al-Malood while Bahrain goalkeeper Sayed Jaffer fended off Iraq's first penalty taken by Ahmed Yasin.
Dhirgham Ismail, Waleem Salem and Younis Khalaf were on target with the other penalties for Iraq while Faozi Ayish and Sayed Dhiya scored for Bahrain.
Earlier, captain and lone striker Khalaf scored what looked like a Iraqi match-winner in the 18th minute, latching on to a through pass from Hammadi Ahmed in the penalty area and successfully shaking off his marker Abdulla al-Marzooqi and beating goalkeeper Jaffer with a low shot which went in off the far post.
Veteran defender Hussain Ali Baba produced the Bahrain equaliser in the 61st minute. His free kick from about 20 metres away from the penalty area shot off like a guided missile over the Iraqi wall and curled into the left top corner of the goal, eluding a diving Sabri.
Signup to our newsletter and follow us on Facebook and Twitter!
It was undefeated Iraq's first goal conceded in this championship.
If that was not enough drama, the all-important goal that saw the UAE through to Friday's final came seconds into the final minute of regular time when the never-say-die Omar Abdulrahman initiated a move inches outside the penalty area on the left and sent Abdulaziz Sanqor through with a well-timed diagonal pass.
Sanqor did well to beat his marker Mohammed Frieh and send a cross past the face of the goal to Khalil, who jabbed the ball low and to the right of Kuwait goalkeeper Nawaf al-Khaldi.
It was Khalil's third goal of the championships and the UAE stands, packed with fans especially flown in by 21 chartered planes, went wild.
The first semi-final was a match of two equal halves with the UAE dominating the first and 11-time champions Kuwait the second.
Both teams came close to scoring, with the UAE's best chance coming in the 60th minute when a long-range free-kick by Khamis Ismael struck the crossbar and bounced back twice off the shoulder of Kuwait goalkeeper Khaldi.
Nine minutes later it was a close shave for Khaldi's Emirati counterpart Ali Khaseif as Fahad al-Ansari, Bader al-Mutwa and Hussain Hakem all had their close shots saved, the Emirati defence just managing to scramble the ball clear.
Kuwait had another chance in the 86th minute when second-half substitute Fahad al-Enezi covered the length of the ground but could not shake off his markers and his move went abegging.
But the UAE and Khalil's patience and perseverance paid off in the final minute, however, a just reward for a team mainly made up of players who took part in the 2012 London Games.