Spain will play in group E, with 2022 runners-up Sweden drawn in group D together with Hungary, Switzerland and Israel.
Group A is an all-Balkan affair of Croatia, Slovenia, Serbia and Greece, while both groups C and F will feature Nordic derbies - between Denmark and Norway, and Iceland and the Faroe Islands, respectively.
Tournament hosts Montenegro chose to join group F, alongside Iceland, the Faroes, and Italy. Germany, who won bronze in 2022, will face France, Poland and North Macedonia.
The M18 EHF EURO 2024 takes place between 7 and 18 August.
Men's 18 EHF EURO 2024
Group A: Croatia, Slovenia, Serbia, Greece
Group B: Germany, France, Poland, North Macedonia
Group C: Denmark, Norway, Czechia, Ukraine
Group D: Sweden, Hungary, Switzerland, Israel
Group E: Spain, Portugal, Austria, Romania
Group F: Iceland, Montenegro, Faroe Islands, Italy
The draw also took place for the M18 EHF Championships in Slovakia and Kosovo, which will take place between 12 and 15 August. For the championships in Slovakia, the four participating teams from the Baltic countries - Latvia, Lithuania, Estonia and Finland - found themselves split into the two groups. In Kosovo, the hosts chose to join the four-team group A alongside Bulgaria, Belgium and Azerbaijan.
Men's 18 EHF Championship I (Slovakia)
Group A: Bosnia and Herzegovina, Lithuania, Estonia, Türkiye
Group B: Latvia, Slovakia, Netherlands, Finland
Men's 18 EHF Championship II (Kosovo)
Group A: Kosovo, Bulgaria, Belgium, Azerbaijan
Group B: Luxembourg, Georgia, Great Britain