The Turkish outfit was among the absolute toughest possible opponents for FC Midtjylland, who could also have been drawn against FC Twente, Tromso and Hammarby.
The first leg will be played in Istanbul. It is scheduled for 23 July, while the return leg will be played in Herning a week later.
Should FC Midtjylland manage to win the two legs on aggregate, the team will have to go through the third qualifying round and the playoff round before reaching the league phase in the Europa League.
