Raith Rovers stole the advantage in the Premiership play-off quarter-final after frustrating then overcoming Hibs.
Substitutes Louis Longridge and Harry Panayiotou combined for the latter to score with a thumping second-half header.
The goal was against the run of play, as Hibs dominated much of the game and created a slew of chances.
Jason Cummings spurned the best of them, when he shot over when clean through on goal in the first half.
The task is now win or bust for the play-off sides, and that delivered a frantic opening. Once the visitors brought some order to their play, though, and John McGinn asserted himself, they began to create half-chances.
Cummings and Marvin Bartley with shots and Anthony Stokes with a header all asked questions of Raith goalkeeper Kevin Cuthbert. Cummings never found his range, though. Even when sent clean through on goal by a superb McGinn pass over the top, the striker lifted the ball high over the bar with only Cuthbert to beat.
Hibs began to look accomplished amidst the hurly burly of the game.
They could afford to commit their wing-backs forward, since Ryan Hardie was a forlorn figure up front on his own for Raith. The home side’s only chance in the first half came when James Craigen swept a first-time half-volley over the bar from the corner of the penalty area.
By the interval, though, the sense was a Hibs breakthrough was inevitable. For Raith, the only comfort was their doggedness and refusal to concede any competitive ground. The visitors recognised that, which is why the creative figures of Dylan McGeouch and Liam Henderson started the game on the bench and Bartley brought steel and physical presence to central midfield.
The decisions seemed sound by Alan Stubbs, not least because his side continued to look the more threatening after the break. Twice Stokes delivered free-kicks from the left that generated a sense of alarm in the Raith penalty area. The first was clawed away by Cuthbert, the second headed just wide by David Gray.
Cummings, too, headed over from close range, and frustrations were growing for Hibs. Stubbs was furious with the officials when he felt a penalty should have been awarded for handball, and his mood only worsened moments later when Raith broke upfield to score.
The home side had been out of sorts in an attacking sense, prompting Ray McKinnon to bring on Panayiotou and Longridge. They combined for the goal, with the latter delivering the corner kick that Panayiotou converted with a stooping header at the near post.
Having been subdued for much of the game, Raith were suddenly alive with confidence and intent. They broke with a sense of purpose, but could not create another clear chance.
Hibs threw on attacking midfielders McGeouch and Henderson, but the visitors had to make do with a narrow defeat and the hope they might turn the tie around in the second leg at Easter Road.