Michael Gregoritsch quickly pulled a goal back for Austria and only a stunning save from Mert Gunok denied Christoph Baumgartner a dramatic equaliser deep into stoppage-time.
Turkey advanced to face the Netherlands in the last eight in Berlin on Saturday.
Austria had emerged as a dark horse to go far on the perceived weaker side of the draw after topping a group including France and the Netherlands.
Ralf Rangnick’s side had also thrashed Turkey 6-1 in a friendly in March, but this time they failed to recover from a nightmare start.
Real Madrid’s Arda Guler was a constant threat to the Austrian defence and his teasing delivery from a corner caused chaos inside the first minute.
Baumgartner’s clearance off the line hit team-mate, Stefan Posch, goalkeeper Patrick Pentz clawing it out to Demiral, who lashed into the roof of the net for the second-fastest goal ever at a European Championship.
Turkey’s raucous fans exploded in a deafening celebration, but they were nearly brought back down to earth straight away.
Baumgartner fired inches wide from the edge of the box before Demiral somehow prevented the RB Leipzig midfielder from scoring at his home ground as a dangerous Austrian corner flashed across goal.
Turkey coach Vincenzo Montella said that absent captain Hakan Calhanoglu, who was missing due to suspension, was “irreplaceable.”
However, Guler assumed responsibility in the playmaking role and nearly produced a stunning second for his side with an audacious attempt from the halfway line that drifted wide.
Only Portugal, Spain and the Netherlands have had a higher winning percentage in European football since Rangnick took charge of Austria two years ago.
– Gunok to the rescue –
The former Manchester United boss made two changes at half-time, including the introduction of Gregoritsch, who scored a hat-trick when the sides met three months ago.
Rangnick got the reaction he desired as Austria began cutting through the Turkish defence.
Gunok spread himself brilliantly to deny Marko Arnautovic when one-on-one before Bayern Munich’s Konrad Laimer lacked the finish to a fine run through the middle.
However, they failed to learn their lesson from Guler corners as another inviting delivery was powered home by Demiral.
In doing so the 26-year-old became the first European defender to score twice in the knockout stages of a major tournament since Lillian Thuram for France at the 1998 World Cup.
It was also a set-piece at the other end that got Austria back in the game seven minutes later.
Posch flicked on Marcel Sabitzer’s corner for Gregoritsch to sweep high into the net.
A torrential downpour could not drown out a sensational atmosphere in Leipzig, with Turkey’s huge expat population in Germany again making it like a home game for Montella’s men.
The fervent atmosphere turned sour as Sabitzer was struck by an object thrown from the crowd as he prepared to take a corner.
Baris Alper Yilmaz was denied a third for Turkey by a fine save from Pentz in stoppage time.
That nearly proved crucial as Gunok then had to produce a remarkable stop to prevent Baumgartner’s downward header from finding the far corner.
It was an incredible save reminiscent of England keeper Gordon Banks’ iconic stop from Pele in the 1970 World Cup.
But Turkey stood firm amid an aerial bombardment from Austria to reach the quarter-finals of a major tournament for the first time since Euro 2008.
AFP