Janni Arnth struck the decisive spot kick to give Denmark a shock victory over a France team that had won all three group games, after the match had finished 1-1 following extra time.
"We dominated after the first half hour," said French coach Bruno Bini. "We had a good team and we played well, but we couldn't find the decisive goal.
"We have to go home now. That is football, that is life."
An upset was in the air as early as the 28th minute when Johanna Rasmussen gave Denmark the lead when she latched on to a long ball and flashed a left-foot shot past French goalkeeper Sarah Bouhaddi.
France equalised from the penalty spot in the 74th minute after Camille Abily was pushed in the back by Line Roddik.
Louisa Necib took the spot kick, and although Stina Petersen got both hands to the ball, she could not keep it out.
The French pressed in vain for a winner but the game finished 1-1, and after extra time went to penalties.
Necib and Sabrina Delannoy both missed from the spot for France leaving Arnth to fire home Denmark's final kick.
Denmark collected two points in the group stage and only made it into the quarter-finals when their name was drawn out of the hat ahead of Russia.
They will now face Nordic neighbours Norway in the semi-final on Thursday.
Solveig Guldbrandsen netted Norway's first on 24 minutes as her cross from the right wrong-footed the defence and sailed into the Spanish goal.
Spain defender Irene Paredes then shanked an attempted clearance past her goalkeeper to put Norway 2-0 up just before halftime.
Ada Hegerberg swept in a sublime third for Norway and Spain's Jennifer Hermoso managed to pull one back in injury time.