Liverpool will be placed in Pot 3 for the Champions League group stages draw on Thursday after Benfica thumped PAOK Salonika.
It means Jurgen Klopp's men, last year's beaten finalists, will face one of Borussia Dortmund, Porto, Shakhtar Donetsk, Napoli, Roma or Benfica.
A PAOK win would have lifted the Reds to Pot 2 and potentially a kinder draw. But two-time European Cup winners Benfica batted back to win 4-1 in Greece.
Goals from Brazilian defender Jardel and midfielder Pizzi, plus two penalties from Argentinian Eduardo Salvio, helped the Portuguese club to a 5-2 aggregate victory.
After drawing the home leg 1-1 in Lisbon, Benfica - who won the competition in 1961 and 1962 - fell behind to an early strike from Serbian forward Aleksandar Prijovic.
The home side were reduced to 10 men with 14 minutes remaining when Leo Matos was sent off for a second bookable offence.
Red Star Belgrade reached the Champions League group stages for the first time in 27 seasons after coming from behind to defeat Red Bull Salzburg on away goals.
Ben Nabouhane scored twice in two second-half minutes for the Serbian champions to secure a 2-2 draw in Austria following a goalless first leg.
Red Star, who won the competition in 1991 and last reached the groups the following year, looked on course for elimination after Israel midfielder Munas Dabbur scored either side of half-time for the hosts.
Elsewhere, Dutch champions PSV Eindhoven eased through following a comprehensive 3-0 success over Belarusian side BATE Borisov.
PSV, European champions in 1988, were in control by half-time at the Philips Stadion thanks to goals from Steven Bergwijn and Luuk de Jong.
Mexico international Hirving Lozano completed a 6-2 aggregate win with the final goal of the night.
The draw for the group stages takes place on Thursday in Monaco and is live on RTÉ News Now and the RTÉ Player.
Watch the Champions League draw live on RTÉ News Now (Saorview channel 21, VM 200, Sky 521, Eir 500) and the RTÉ Player from 5pm on Thursday 30 August