Holders Manchester City will play Copenhagen in the last 16 of the Champions League, while Arsenal face Porto.
Danish champions Copenhagen, who finished above Manchester United in their group, reached the knockout stage for the first time since 2011.
The first legs take place on 13-14 or 20-21 February and the second on 5-6 or 12-13 March.
City and Arsenal are seeded, meaning they will play the second leg at home.
Record 14-time winners Real Madrid meet RB Leipzig, while Inter Milan – runners-up last season – play Atletico Madrid, and Bayern Munich face Lazio.
The final takes place at Wembley on 1 June.
Last-16 draw
Porto v Arsenal
Napoli v Barcelona
Paris St-Germain v Real Sociedad
Inter Milan v Atletico Madrid
PSV Eindhoven v Borussia Dortmund
Lazio v Bayern Munich
Copenhagen v Manchester City
RB Leipzig v Real Madrid
Premier League leaders Arsenal, who topped Group B but have never won the Champion League, beat Porto 5-0 at Emirates Stadium the last time they met in 2010.
Runners-up in Portugal’s Primeira Liga last season, Porto won four of their six Group H games to finish level on points with Group H winners Barcelona.
City won Group G with a 100% record, while Copenhagen, who lost 1-0 at United before beating them 4-3 at home, were runners-up to Bayern in Group A.
Pep Guardiola’s side have progressed from the last 16 stage in each of the past six seasons in the Champions League.
Analysis
Ian Dennis, BBC Radio 5 Live senior football reporter
The draw has been very kind to the two English teams and both should be very happy.
Arsenal have won all three previous encounters against Porto, although they have never won at the Estadio do Dragao.
City played Danish champions Copenhagen in the group stage last season, drawing 0-0 in Denmark but winning handsomely 5-0 at home.