Scotland will face Germany in the qualifying games for Euro 2016, along with the Republic of Ireland and Gibraltar which was moved into the group for political reasons.
Gibraltar were originally drawn in the same qualifying group as Spain but were moved into Scotland's group for political reasons.
Group D is now comprised of Germany, the Republic of Ireland, Poland, Scotland, Georgia and Gibraltar.
European football's governing body UEFA had already announced in December that Gibraltar and Spain would be kept apart amid continuing political tensions over the territory's sovereignty.
The territory, which has a population of 29,000, became a full member of UEFA last year and will be competing in the qualifying round for the first time.
Today's draw took place as three Royal Navy warships were set to dock in Gibraltar as the row between the UK and Spain over the Rock rumbled on.
HMS Westminster, HMS Brocklesby and HMS Daring were reportedly due to carry out patrols after a Spanish warship interrupted an elite forces training exercise last week.
The top two teams from each Euro 2016 qualifying group plus the third-placed team with the best record qualify automatically for the finals. The remaining eight third-placed teams will contest play-offs.
Qualifiers will be played between September 7, 2014, and October 13, 2015. Play-off matches will be played in November 2015.
Group A: Holland, Czech Republic, Turkey, Latvia, Iceland, Kazakhstan
Group B: Bosnia-Herzegovina, Belgium, Israel, Wales, Cyprus, Andorra
Group C: Spain, Ukraine, Slovakia, Belarus, Macedonia, Luxembourg
Group D: Germany, Republic of Ireland, Poland, Scotland, Georgia, Gibraltar
Group E: England, Switzerland, Slovenia, Estonia, Lithuania, San Marino
Group F: Greece, Hungary, Romania, Finland, Northern Ireland, Faroe Islands
Group G: Russia, Sweden, Austria, Montenegro, Moldova, Liechtenstein
Group H: Italy, Croatia, Norway, Bulgaria, Azerbaijan, Malta
Group I: Portugal, Denmark, Serbia, Armenia, Albania
France qualify as hosts, but will play friendlies against teams in Group I. There will be no points awarded for games in which France figure, so these will have no affect on the Group I table.