Striker Darwin Nunez headed home a 77th-minute winner as Benfica grabbed a shock 1-0 victory away at Ajax Amsterdam on Tuesday to secure a surprise Champions League quarterfinal place.

The Uruguayan striker rose above the Ajax defence to score from a free kick in a rare attack for the Portuguese club, which put up a stout defensive performance at the Johan Cruyff Arena to advance 3-2 on aggregate.

Benfica's veteran centre back pair of Jan Vertonghen and Nicolas Otamendi were a defensive wall that Ajax was unable to break down, despite dominating possession and constantly attacking the visitor's goal.

The Dutch club had won all its group games and, after a 2-2 draw in the first leg of the last-16 tie in Lisbon last month, was expected to ease through to the last eight with home advantage in the second leg.

But its hopes of an extended run in the Champions League were brought to a sudden end by Benfica, which has had a poor domestic season and flounders 12 points from the summit of the Portuguese league.

Ajax peppered the Benfica goal in the first half at the end of swift build-ups and multiple crosses into the penalty area, but got few of its efforts on target.

READ | EU slaps sanctions on Chelsea owner Roman Abramovich

Teenager Ryan Gravenberch created an opening for himself with a strong run but fired his 36th-minute shot just over the crossbar in the best effort of the opening period.

Ajax kept up the pressure in the second half with Brazilian winger Antony having two good chances. He put a header wide and was then foiled by a late Vertonghen tackle.

Benfica’s one attempt on target came after Ajax defender Edson Alvarez conceded a soft free kick.

Nunez rose high above Jurrien Timber and the on-rushing goalkeeper Andre Onana from the set piece to stun the home crowd.

“Obviously, I'm very happy. It was a very difficult game, we knew we all had to run when it came time to defend and attack,” Nunez told reporters.

ALSO READ | Nevada court should get Ronaldo police file issue, says US Judge

“We played against a team that plays very well, we knew we were going to suffer, we suffered, we had to defend but our team gave everything,” he added.

Ajax could have equalised deep in stoppage time but Benfica goalkeeper Odysseas Vlachodimos pulled off a superb stop to deny Brian Brobbey, although the Ajax substitute was then ruled offside.

Elimination was a bitter blow said home captain Dusan Tadic.

“We stopped all their efforts to counter attack and then we lose from a free kick ... We didn't deserve to lose. We were the better team, but in Europe it's also about set pieces and counters. Then such a moment can be fatal.”