Europa League qualifying: Aberdeen 2-1 RoPS Rovaniemi
Aberdeen turned a comfortable Europa League advantage into a precarious one by conceding an injury-time consolation to RoPS Rovaniemi at Pittodrie.
On the day that manager Derek McInnes signed a new contract, Niall McGinn delicately chipped the Scots ahead.
And Sam Cosgrove squeezed in a second to put them in a commanding position.
But instead of playing next Thursday's second leg in Lapland with a two-goal cushion, Aberdeen face a nervy night after Tommi Jantti's late strike.
Chikhura Sachkhere or Fola Esch await in the second round, with Georgian side Chikhura winning the first leg 2-1 in Luxembourg and looking favourites to visit Pittodrie in two weeks' time should Aberdeen maintain their narrow advantage.
McInnes' side are competing in the Europa League for the sixth consecutive season, but have yet to get past the third qualifying round of the competition.
- McInnes confirms interest in Hibs target Ojo
- Name Aberdeen's Euro scorers under McInnes
- How do clubs plan European trips?
Reguero denies Aberdeen
Aberdeen went into the game buoyed by the news manager McInnes and his assistant Tony Docherty had signed new deals to stay until the summer of 2022 but started cagily.
Two of their seven summer signings - Jon Gallagher and Ryan Hedges - included in the XI and both were heavily involved.
Hedges looks a shrewd acquisition from Barnsley and the Welsh international was denied a goal when his effort was parried wide by former Kilmarnock, Hibernian, Inverness Caledonian Thistle and Ross County goalkeeper Antonio Reguero.
The Spanish custodian was beaten by Sam Cosgrove, though, when last season's top scorer got on the end of Andrew Considine's cross, but his effort from a close range flashed wide.
Aberdeen did, though, take the lead in some style after 35 minutes. A Hedges delivery was met by McGinn, who showed great skill to spin and dink the ball over Reguero from the tightest of angles.
The Northern Ireland international then turned provider, his cross was met by Cosgrove who had another header tipped over by Reguero.
Aberdeen started the second half with a real spring in their step and doubled their advantage within three minutes of the restart. McGinn played in the impressive Gallagher, who pulled the ball back for Cosgrove to find the net from close range.
The hosts were threatening to run riot. McGinn and Hedges forced good stops from Reguero, who then brilliantly thwarted a ferocious Cosgrove strike from 15 yards out.
If it wasn't for Reguero this could have been a rout and, as full time neared, he produce further fine stops to deny Cosgrove, Ferguson and Connor McLennan.
However, at the death, the visitors gave themselves a lifeline. Tarik Kada had already forced a fine save from Joe Lewis before fellow substitute Jantti beat the offside trap to fire a finish into the net.
'It will be nervous over there' - analysis
Former Aberdeen captain and manager Willie Miller on Sportsound
I still think they'll get through but it's a dangerous situation now for Aberdeen. That's turned the tie round, that away goal. Aberdeen should be cruising into the next round. It should be four or perhaps even five that they've scored.
It's all down to a lapse of concentration at the end. It should not have been allowed because that's a game that they have dominated. It's not going to be easy over there. This team can pass the ball. They are going to have to play well and it will be nervous.
- 11HedgesSubstituted forCampbellat 61'minutes
- 10McGinnSubstituted forWilsonat 82'minutes
- 16CosgroveBooked at 40mins
- 15WrightSubstituted forMcLennanat 74'minutes
- 5KatzBooked at 25mins
- 88SissokoBooked at 73mins
- 14MuinonenSubstituted forKadaat 57'minutes
- 8LlamasBooked at 19minsSubstituted forJänttiat 76'minutes
- 11KokkoSubstituted forJokelainenat 65'minutes
- 33Pinto Moraes Junior
- Kaspar Sjöberg
- Shots on Target