HANGZHOU, China (AFP) - Brazil scored a last-gasp goal to book their place in the women's World Cup quarter-finals here Thursday, with their 1-0 victory crushing the dreams of a desperate Denmark.
Substitute Pretinha did the damage, scoring in the 91st minute after both sides came close in regulation time, to keep the South American powerhouse on course for their first title.
Denmark, whose campaign at this World Cup has been dogged by controversy, needed to win to keep their hopes alive, and are now out.
Brazil were virtually guaranteed of advancing before kick-off after securing enough points by earlier thumping minnows New Zealand and hosts China, to finish on top of Group D.
The fleet-footed Canarinha now take on Australia in Tianjin city on Sunday, after the Matildas qualified by drawing with Canada, also Thursday.
"We were so keen to win, but we lost a lot of chances, but we finally scored to win," said player of the match Daniela.
Coach Jorge Barcellos said he had lineup problems because he did not want three players, including Daniela, already on yellow cards to risk getting booked again and miss the quarter-final.
But he finally found the right combination after half-time.
With the 40,000-strong crowd chanting her name, masterful Marta was scorching for Brazil, often sprinting down the left wing leaving Danish defenders in her wake, to cross to teammates lurking nearer the goal.
Cristiane, whose relentless pace also caused problems, latched onto a lightning quick pass from Marta in the 14th minute but the 22-year-old forward miscued her shot which went wide.
Daniela should have scored on 20 minutes, when she found herself with space just inside the area, but fired over the bar.
But Denmark, ranked six in the world, also looked dangerous with several shots on target in the first half, as the Brazilian defence scrambled to clear danger inside the box.
Brazil came out firing in the second period, Marta launching a missile that goalkeeper Heidi Johansen flicked over the bar. She fired another that scraped the top of the woodwork on 55 minutes, bringing roars from the crowd.
But it was Pretinha, who came on after half-time, who ensured victory, latching onto a long ball on the right wing and lobbing her shot over an advancing Johansen.
Denmark assistant coach Per Nielsen praised his charges, saying they had plenty of chances.
"It was a great match and we put in an excellent performance but unfortunately we lost 1-0 but that's how it goes," he said. "I think we had our chances, no doubt."
Denmark's head coach Kenneth Heiner-Moller was sitting in the stands, serving a suspension for unsportsmanlike conduct earlier in the Cup.
The Danes have vowed to pursue an apparent spying incident that has dogged this tournament. Denmark were outraged to find two men, described as Chinese, with cameras hiding behind a two-way mirror ahead of the team's key tactical meeting before their clash with China.
FIFA insist the case is closed.
The South Americans, who have played in every World Cup since the tournament's inception in 1991, stormed to a third place finish in 1999 only to crash out in the first round in 2003.
|Montreal Impact 3 Chicago Fire 0: Piatti double sinks slumping visitors|
|Pique: This is the first time I´ve felt inferior to Real Madrid|
|Asensio: Madrid played better and deserved Supercopa title|
|Barca star Suarez to undergo tests on knee injury|
|Barca close to signing Coutinho and Dembele - Segura|
|Valverde: Madrid aren´t invincible as Barca boss laments Neymar loss|
|Zidane lauds ´spectacular´ Madrid after Supercopa triumph|
|PSG troll Barcelona over Supercopa loss to Madrid|
|Real Madrid 2 Barcelona 0 (5-1 agg): First-half Barca failings settle Supercopa|
|Champions League Review: Mertens stars as Napoli put two past Nice|
|Rodgers eyes Liverpool reunion after ´perfect´ Celtic hammer Astana|
|Demebele can´t just do whatever he wants - Dortmund team-mate Sokratis|
|Championship Review: Norwich off the mark, Sheffield Wednesday hold Sunderland|
|Celtic 5 Astana 0: Sinclair double helps put Rodgers´ men on brink of qualification|
|Sigurdsson to Everton joins Lukaku, Torres and Sterling among biggest all-Premier League deals|
|Sigurdsson completes club-record move from Swansea to Everton|
|Izquierdo granted work permit ahead of club-record Brighton switch|
|Van Persie and Babel win Netherlands recalls|
|Ronaldo brands five-match ban ´exaggerated and ridiculous´|
|Bayern in ´good rhythm´ after poor pre-season - Ancelotti|
|Van Dijk not for sale, says Southampton chairman|
|Liverpool loan Ojo to Fulham|
|Ronaldo´s appeal against five-match ban rejected|
|PSG´s Matuidi arrives in Turin to complete Juventus switch|
|Barcelona threaten legal action over Paulinho deal allegations|
|Sigurdsson undergoes Everton medical, Koeman lavishes praise|
|Boateng leaves Las Palmas for personal reasons|
|Coutinho one of the best in the world, says Liverpool team-mate Can|
|Pulisic staying at Dortmund despite Liverpool speculation|
|Gundogan not rushing Premier League comeback|
|Carlos Bacca joins Villarreal from AC Milan|
|Wenger happy Sanchez & Oxlade-Chamberlain have not followed Coutinho path|
|Newcastle land Joselu in £5m deal|
|Jese Rodriguez joins Stoke from PSG|
|No progress on Alexis Sanchez contract, admits Arsenal boss Wenger|
|Klopp excited by ´incredible´ Alexander-Arnold after starring role in Liverpool win|
|Melbourne Victory confirm Sanchez signing|
|Aston Villa fans ´carried away´ after Terry signing, says Bruce|
|Hoffenheim had ´clearer´ chances, says Nagelsmann|
|Pogba determined to win Premier League with Man Utd|
|Championship Review: Ipswich win again in dramatic fashion|
|Klopp insists Liverpool still have work to do|
|Alexander-Arnold delighted with ´dream´ goal and Liverpool win|
|Hoffenheim 1 Liverpool 2: Klopp´s men secure fine away win in Champions League|
|Iniesta to miss Supercopa de Espana decider through injury|
|No comparison between Sanchez and Costa - Wenger|
|West Brom sign Barry to fill Fletcher void|
|Girona 1 Manchester City 0: Gundogan returns in friendly defeat|
|Balotelli a big loss but Nice are still dangerous, warns Napoli boss Sarri|
|Nothing is impossible - Barca and Valverde prepared to attack Madrid|
|Roberto and Samper in Valverde´s future Barca plans|
|Busquets hits out at Barcelona´s Segura over Pique blame|
|Fiorentina sign winger Dias from Monaco|
|S*** happens - Guidetti frustrated but determined after operation|
|Lawrence leaves Leicester for Derby in reported £7m deal|
|City´s Ederson proud of Brazil call-up|
|Bonucci targeting Champions League title at Milan|
|Buffon, Messi, Ronaldo up for UEFA Men´s Player of the Year award|
|Real Madrid US tour woes never worried Zidane|
|Arda agent denies deal with Galatasaray|
|Something is up - Real Madrid boss Zidane questions Ronaldo ban|
|Coutinho exit would be awful for Liverpool, admits Firmino|
|Ronaldo ban excessive, says Real Madrid defender Carvajal|
|Sammer sees Kimmich as leader for Bayern and Germany|
|That´s why Rooney´s in my fantasy team - Everton keeper Pickford delights in hero´s return|
|Dembele wasn´t ready for Barca last year, says ex-Bayern director|
|Mkhitaryan: Lindelof will prove his worth at Man United|
|Socceroos trio Jedinak, Spiranovic and Smith return ahead of qualifiers|
|Everton to buy house for homeless teenagers|
|Klopp has no say in Coutinho saga amid Barca speculation|
|Klopp unhappy as Can contract talks stall|
|Jack Wilshere makes comeback from leg fracture for Arsenal Under-23s|