The final Champions League play-off round draw took place this morning and saw Dundalk drawn against Legia Warsaw.
The Polish side are now all that stand between Dundalk and a place in the group stages of the competition.
The Lilywhites, who currently lead the League of Ireland, were the team with lowest coefficient rating in the draw.
Dundalk will play their home leg at the Aviva Stadium the week after next (August 16/17) with the return leg taking place at the Stadion Miejski a week later (August 23/24). Exact dates and times are to be confirmed later.
They could have been drawn against Scottish champions Celtic but Brendan Rodgers men will instead play Israeli side Hapoel Beer-Sheva.
In the other draw, Manchester City have been drawn against Steaua Bucharest in their Champions League play-off tie.
City finished fourth in the Premier League and so must earn their place in the lucrative group stage, as new boss Pep Guardiola looks to go one better than last season's semi-final run under Manuel Pellegrini.
Manchester City sporting director Txiki Begiristain says there will be no complacency against the Romanians.
"It's going to be a difficult tie because Steaua are on the up again in Europe and have a lot of talent," he said on www.uefa.com.