The Eintracht Frankfurt striker had been in talks with the Moroccan federation, but a call from the new Germany head coach settled the matter.
He told Sky: "There were talks with Morocco. But when Jürgen Klopp calls, you can't say no."
Ebnoutalib, born in Frankfurt to a German mother and Moroccan father, had previously represented Morocco at under-15 level and was tracked by Moroccan coach Mohamed Ouahbi, who watched him in Germany and spoke to him during a recent tour of Europe.
Ouahbi did not select him for this summer's World Cup, a decision the striker said had disappointed him at the time, though he insisted both countries remained live options until Klopp's intervention.
He has now received his first call-up to Germany's squad, alongside Kai Havertz as the only recognised strikers in Klopp's plans.
The 23-year-old's rise has been rapid. After a run of eight months in the German fourth tier with Gießen, he joined SV Elversberg, where he top-scored in 2. Bundesliga before Eintracht Frankfurt paid around €8 million to sign him in January this year.
Following a long injury lay-off, he has started this season with five goals and two assists in five games, including a hat-trick against Union Berlin. Klopp praised his qualities after naming him in his first squad, saying his intelligence in the final third is exceptional.
