Qatar's handball team created history in the desert on Wednesday qualifying for their first ever world championships semi-final after beating Germany 26-24 in a superb encounter,
The win sparked wild celebrations among players and crowd, which included the country's emir, Sheikh Tamim bin Hamad al Thani.
And on a night of high drama at the Lusail stadium, reigning world champions Spain then edged through against Denmark 25-24 with a last-second winner from Joan Canellas.
It means Spain set up a heavyweight clash against current European champions France in one semi-final.
The French cruised through beating Slovenia 32-23, in an ominous warning to the other sides.
Qatar will play Poland in the easier-looking of the two semi-finals, giving the hosts a strong chance of making their first ever final.
Qatar may have achieved their last-four spot by drafting in several foreign players but for a nation that had previously never got any further than the last 16, progression to the semi-finals is still a notable achievement.
After the match, Qatar's coach Valero Rivera said the first 30 minutes was the most impressive they had played in the tournament.
"I think the first-half performance, we played our best handball in the championship and we won because of that," he said.
German star player Uwe Gensheimer said the best team won.
"They really deserved it today," he said.
Once again it was Qatar's big game players -- Zarko Markovic, Rafael Capote, Danijel Saric and Borja Vidal, all of them foreign-born who dominated and helped the hosts into the last four.
Markovic is now the tournament's top scorer with 55 goals. Goalkeeper Saric won the man-of-the match award.
It was not until the 13th minute that either team was able to establish any sort of lead when two quick penalties for Qatar, both converted by Markovic, gave the home side a 6-3 lead.
Germany struck back immediately through Gensheimer but this served only to show the tension on the court as he clashed with Qatar's Roine immediately after scoring and the two had to be separated by teammates. Both players were sin-binned.
Signup to our newsletter and follow us on Facebook and Twitter!
- Disapproval -
Tensions rose again immediately after when a shot from Qatar's Rafael Capote was initially adjudged not to have crossed the line after being half-stopped by Lichtlein.
But the off-the-court referee ruled -- probably correctly -- that the shot had gone in, to the disapproval of German players and fans in the packed 15,300-seater stadium, to give Qatar a 10-6 lead.
Qatar's dominance of the rest of the first half was neatly summed up in a fine one minute passage of play when substitute keeper Goran Stojanovic saved a penalty and the team swept downfield to score through a superb shot from Capote to extend their advantage to 16-9.
Given the seven-goal cushion, the Qataris were probably unhappy to go into the break with just a four-goal advantage, leading 18-14, as the Germans struck back through Gensheimer again.
Germany closed that deficit to just one within nine minutes of the restart when Patrick Groetski beautifully lobbed Saric for the finish of the match.
A second incident when Germany questioned whether a Qatar goal had crossed the line at the halfway mark of the second half, to make it 24-22 in the hosts' favour, prompted further protests from the Europeans.
Into the final minute Qatar retained their two goal lead, thanks to two superb stops by Saric.
It ended up being a good night for the Rivera family.
The Qatar coach's son, also called Valero Rivera, scored 10 goals in Spain's dramatic encounter with Denmark.
The game remained in the balance throughout and was only settled with the last touch when Canellas scored with a powerful shot.
The result was tough on Denmark, and especially Mikkel Hansen who scored six goals in a superb second-half performance.
France confirmed their position as favourites, easily beating Slovenia, the game was over as a contest by half-time with the French taking an 18-10 lead.
Poland beat Croatia 24-22 in the remaining quarter-final.