Mohamed Salah's first-half goal gave Liverpool the win they needed to secure a place in the Champions League knockout stage.
Jurgen Klopp's side needed a victory with a clean sheet or by two clear goals to make the last 16 - and in-form talisman Salah obliged by beating Napoli keeper David Ospina at his near post in the 34th minute.
Liverpool fully deserved their victory as Ospina partially redeemed himself with fine saves from Salah and Sadio Mane, with the latter and Virgil van Dijk also missing clear chances to extend the home side's advantage.
The clean sheet was the key, however, and Liverpool survived a huge scare in injury time when goalkeeper Alisson made a crucial save from Arkadiusz Milik in a rare Napoli opening.
Liverpool go through in second place behind Paris St-Germain - a feat achieved despite losing three away games in their group.
The Reds, who were beaten by Real Madrid in last season's final, will face one of the group winners when the last-16 draw is made on 17 December.
That could lead to another meeting with the champions, while their Spanish rivals Barcelona, Klopp's former charges Borussia Dortmund and Portuguese champions Porto have also advanced by topping their groups.
Have your say
More Sports Headlines
- ANALYSIS: Is it time for Kwesi Appiah's Black Stars to ditch playing 4-4-2?
- 2019 AFCON: Benin qualify as Adebayor's Togo go out
- Tanzania seal Afcon return after 39 years
- Appiah reveals reasons for Asamoah's no-show against Kenya
- First Ghana goal excites Caleb Ekuban
- Ghana 1-0 Kenya: Five things we learned
- Player Ratings: Ghana 1-0 Kenya
- 2019 Afcon qualifier: Ekuban debut goal saves Ghana's blushes
- U-23 Afcon qualifier: Ghana thrash Gabon 4-0 in first leg
- 2019 AFCON: Burundi seal historic qualification
- 2019 AFCON qualifier: Ghana vs Kenya preview
- Sterling bags hat-trick as England thrash Czech Republic
- Portugal draw blank against Ukraine on Ronaldo's return
- Messi returns but Argentina lose 3-1 to Venezuela
- Normalisation Committee to stay on another six months