AC Milan landed a favourable Europa League play-off draw in Nyon on Friday as they were pitted against Macedonian side Shkendija.
Vincenzo Montella's side edged out city rivals Inter to finish sixth last season and secure a spot in Europe after a three-year absence.
Opponents Shkendija, who lost to Gent in the play-off round last time out, finished second in the First League.
Ajax, who lost the 2016-17 final to Manchester United and have since appointed Marcel Keizer as head coach after Peter Bosz left for Borussia Dortmund, were drawn to face Norwegian champions Rosenborg.
A 2-0 defeat in Stockholm denied the Eredivisie club a first European title since 1995.
Premier League side Everton, managed by former Ajax star Ronald Koeman, were pulled out alongside Hajduk Split, while Marseille will tackle Slovenia's Domzale.
Roberto Mancini's Zenit face Utrecht, with the final to be played in Lyon.
The ties will take place on August 17 and 24.