"I hereby resign immediately from the national team," Wagner told German daily Bild.
"For me, it is clear that I do not seem to fit with the coaching team in the way I am always open, honest and address things directly."
The 30-year-old took a thinly-veiled swipe at head coach Joachim Loew for leaving him out of the 27-man squad, announced on Tuesday, for next month's World Cup as strikers Timo Werner, Mario Gomez and Nils Petersen were selected instead.
Wagner, who made his debut in 2017, helped an inexperienced squad win the Confederations Cup in Russia last July and has scored five goals in just eight internationals.
"I would lie if I said that I am not disappointed, the World Cup would have been a great thing," said Wagner.
"Of course, I can't take it too seriously, because, as I have said many times before, there are far more important things in life besides football."
Wagner's omission was a surprise given his impressive form this year for Bayern, the club he joined in January as Robert Lewandowski's back-up, scoring an impressive nine goals in 17 games, mainly off the bench.
He is understandably red-faced having said in numerous post-match interviews this year that he expected to make the World Cup squad.
However, his out-spoken nature clearly counted against him in the appraisal of Loew, who must cut four names from the provisional list for Germany's final 23-man squad, which must be submitted by June 4, for the World Cup finals.
Germany open their World Cup campaign against Mexico in Moscow on June 17 and also face South Korea and Sweden in Group F.