AaB progressed into the Europa League last-32 despite Yonathan Del Valle's second-half brace handing Rio Ave a 2-0 victory in their final Europa League Group J clash at the Estadio do Rio Ave.
Leaders Dynamo Kiev's 2-0 victory at Steaua Bucharest meant AaB held onto second spot in the group table by two points, while Pedro Martins' men went out confident winners thanks to Del Valle's double.
The Primeira Liga side started strongest as Del Valle sent his long-range effort wide in the opening exchanges.
Emmanuel Boateng had their first shot on target seven minutes in but the 18-year-old's 12-yard strike was held out by a fantastic save by AaB goalkeeper Nicolai Larsen, while 10 minutes later Ahmed Koka was unlucky to hit the post with a header from inside the six-yard box.
The away side could have taken the lead had Thomas Enevoldsen's close-range effort from the centre of the penalty box not been blocked by defender Tiago Pinto in their first half-chance of the match.
Rio Ave were frustrated as they tried to press forward, however, a handball by Pedro Moreira almost brought an opener for AaB but Nikolaj Thomsen's resulting free-kick from 25 yards out on the right was comfortably saved by Cassio.
The hosts came close again as the half drew to a close, but Larsen was on hand to keep out Boateng's curling effort from the right of the penalty box.
Larsen was called upon again as the second half got underway and he comfortably kept out Luis Gustavo's cross as the home side looked to break the deadlock.
AaB came back with a chance of their own but Nicklas Helenius' shot from the edge of the box was blocked by home defender Andre Vilas Boas before Cassio denied Kasper Risgard.
But as the match approached the hour mark, against the run of play, it was the home side that took the lead as Del Valle picked up Renan Bressan's assist and curled the ball brilliantly into the top-right corner from 20 yards out.
Kent Nielsen's side searched for a fast equaliser but Thomsen's long-range strike moments later went wide.
Pinto set up Hassan as Rio Ave looked to double their score with just over 20 minutes remaining but the Egypt striker sent his header sailing past the left-hand post.
The away side fought for a leveller and Risgard forced a brilliant save from Cassio deep into the second half, but Del Valle struck again for the hosts -- after 79 minutes -- as he converted Hassan's cross with a cool close-range finish.
Second-half substitute Tarantini almost had the last say as Rio Ave looked to add some gloss in the dying moments, but Larsen made a simple save.