(CNN) -- The Netherlands came from a goal down to beat 10-man Brazil 2-1 in their World Cup quarterfinal clash in Port Elizabeth on Friday.
An early goal from Robinho had put Brazil in command, but in the second half the Dutch drew level when Wesley Sneijder's cross was deflected into his own net by Felipe Melo.
Inter Milan's Sneijder then headed his team ahead in the 68th minute after Arjen Robben's corner had been cleverly flicked on by Dirk Kuyt.
A miserable afternoon for Melo was completed when he was sent off for stamping on Robben.
The Dutch will play either Uruguay or Ghana in the semifinals, but for Brazil and coach Dunga it is a bitter defeat.
"We are all responsible for this situation but I have the greatest responsibility," he told AFP.
The inspirational Sneijder was surprised to score the winner with a rare headed goal.
"This was my first header here, I don't think it will happen again, but it was great," he told AFP.
"The ball slipped on my bald head and went into the net, a great feeling."
The 26-year-old added: "If you can eliminate Brazil, one of the best teams in this championship the first feeling is relief, we always believed in it."
A Dutch victory had looked unlikely as the five-time World Cup champions took charge from the start.
Melo found Robinho with a precise pass through a static Dutch defense and he made no mistake as he swept his shot past Maarten Stekelenburg in the 10th minute.
Further chances fell to the Brazilians as Dani Alves set up defender Juan who blazed his volley over.
The best move of the match involving Robinho and Lus Fabiano saw Kaka draw a brilliant save from Stekelenburg, while right back Maicon shot into the side netting on the run as half-time approached.
There seemed no way back for the Dutch, but a 53rd minute aberration from Brazil keeper Julio Cesar turned the tide of the match.
He totally missed Sneijder's left-footed cross from the right and the unfortunate Melo saw it brush his body before finding its way into the net.
More poor defending allowed Sneijder to give the Dutch the lead and when Melo was deservedly shown red it was the end of the line for the South American champions.
Only a strong run and shot by Kaka which was deflected away offered them much hope and they might have fallen further behind to Dutch counter attacks.