Despite facing a Swedish side that boasted six wins from their last seven games, Slovenia started positively and should have taken the lead after only four minutes.
Benjamin Sesko’s exquisite delivery from the edge of the penalty box found an unmarked Petar Stojanovic, but he fluffed his lines with the goal at his mercy, as his air shot allowed the visitors to clear the ball away from danger.
Sweden duly punished that miss through Anthony Elanga on 18 minutes, with his fifth international goal at senior level coming when he linked up superbly with Ayari inside the penalty area and kept his composure to slam the ball into the back of the net.
That saw Sweden enjoy a sustained spell on top, and the visiting fans would have been even more vocal, had Ayari not wasted an excellent opportunity from the edge of the penalty area just before the half-hour mark.
Slovenia also found their ability to capitalise on a let-off, and levelled things up just 36 seconds after the interval, following a dreadful error by Malmo goalkeeper Robin Olsen.
A speculative 25 yard effort from Sandi Lovric should have been dealt with comfortably, but Olsen somehow allowed the ball to slip through his fingers to gift the hosts a vital equaliser.
The second half was a largely scrappy affair, but it was Jon Dahl Tomasson’s side who edged back in front after 73 minutes, when Ayari bundled the ball home from close range. It was certainly no goal of the season contender, but the travelling Scandinavian support certainly didn’t care about that.
However, with the prospect of a home defeat looming large, Matjaz Kek’s side grabbed a dramatic 90th minute equaliser when Swansea City forward Zan Vipotnik smashed the ball into the back of the net.
This result means that Slovenia have still never defeated Sweden in their history. With the UEFA WCQ Group B only consisting of four nations, Sweden will be crushed that they could not hold on for three points.
Slovenia’s late leveller gives them renewed hope of qualifying for the World Cup for just the third time in their history.