Germany's football association (DFB) has "emphatically rejected" allegations of racism from Arsenal's Mesut Ozil, but says it could have done more to protect him from abuse.
Ozil, 29, said he no longer wants to play for Germany, citing "racism and disrespect" within German football.
The midfielder says he received hate mail and threats, and was blamed for Germany's disappointing World Cup.
The DFB said it "regrets the departure of Mesut Ozil from the national team".
It added in a statement: "We emphatically reject the DFB being linked to racism. The DFB has been very involved in integration work in Germany for many years."
Ozil was criticised by the DFB and in the German media after being photographed with controversial Turkish president Recep Tayyip Erdogan at an event in London in May.
He received more criticism after Germany were knocked out of the World Cup in the group stage.
The DFB conceded it had not handled the matter well, adding: "It is regrettable that Mesut Ozil felt that he had not been sufficiently protected as a target of racist slogans."
It stressed its commitment to equality, saying: "The DFB stands for diversity, from the representatives at the top to the boundless, day-to-day dedication of people at the base."
Ozil, a third-generation Turkish-German, was born in Gelsenkirchen and was a key member of his country's 2014 World Cup-winning side.
A month before Germany defended their title, Ozil met Erdogan, along with fellow Germany international Ilkay Gundogan, a Manchester City player who is also of Turkish descent. Ozil says he and Gundogan talked about football with the president.
Afterwards, photographs were released by Turkey's governing AK Party in the build-up to elections in the country, which Erdogan won.
Many German politicians questioned Ozil and Gundogan's loyalty to German democratic values. Germany has previously criticised the Turkish leader's crackdown on political dissent following a failed coup.
The players met the German FA president to explain the image, though Ozil had not issued a public statement on the matter until Sunday.
He said Erdogan had also met the Queen and Prime Minister Theresa May while in England, and said he would have been "disrespecting his ancestors' roots" had he not posed for photographs with the Turkish president.
"It wasn't about politics or elections, it was about me respecting the highest office of my family's country," he added.
Ozil has 92 caps and has been voted the national team's player of the year by fans five times since 2011.
He said his recent treatment made him "no longer want to wear the German national team shirt".
"I am German when we win, but I am an immigrant when we lose," he said.
German Chancellor Angela Merkel "respects" his decision as he has done much for the national side, her spokesperson said on Monday.
Anti-discrimination charity Kick It Out said the "racist treatment" Ozil has faced in Germany since his country's World Cup exit was "disgraceful".
Several fellow footballers have come out in support of the Arsenal player.
Among them is club-mate Hector Bellerin, who said: "Surreal that someone who has done so much for his country on and off the pitch has been treated with such disrespect. Well done Mesut for standing up to this behaviour."
The view in Germany
Germany is home to about three million people of Turkish descent - a point regularly raised in political debate in the country, where immigration and the rise of far-right parties are key issues for many.
In his statement, Ozil questions why other dual-heritage team-mates have not been subjected to the same treatment.
"Is it because it is Turkey? Is it because I'm a Muslim? I think here lays an important issue," he said.
German newspapers have criticised Ozil's decision to quit the national team.
The popular tabloid Bild said despite Ozil's appeals for respect for the highest office of his family's country, he "ignores that Erdogan stands against the values of his German and Turkish homelands".
It noted the footballer failed to mention in his "yammer Facebook post" that Erdogan is "transforming the freedom-loving, religiously moderate Turkey into an Islamist dictatorship" and "has almost extinguished free media and freedom of expression".
Frankfurter Allgemeine argued Ozil's resignation has left behind a "pile of shards", adding his "sweeping blow" will immerse the German FA in crisis.
"In many ways, Ozil has overshot the target," the daily said, describing Ozil's attacks on the media as "absurd" and "outrageous".
Die Welt commented that the commitment in wearing a German football shirt means "more than a good game".
"National players are role models, especially for young people with migration background," it said.
"Germany has to formulate its expectations clearly, and every athlete wandering between cultures has to decide whether he can or wants to do that. Those who accept the German passport and put on the national jersey must know what that means for them. The Ozil case made that clear," the paper added.
The view in Turkey
Turkish government officials have overwhelmingly welcomed Ozil's decision.
"An extremely accomplished footballer provides a perfectly reasonable explanation for meeting with President Erdogan. But imagine the pressure under which he felt compelled to make this statement. What a pity for those who claim to be tolerant and multiculturalist," presidential spokesperson Ibrahim Kalin said.
"I congratulate Mesut Ozil who scored the most beautiful goal against the virus of fascism by leaving the German national team," Justice Minister Abdulhamit Gul said.
"We wholeheartedly support the honourable stance that our brother Mesut Ozil maintained," Youth and Sports Minister Mehmet Kasapoglu said.
Ozil's decision was breaking news across Turkish media outlets on Sunday, and continued to be a major story on Monday.
Several channels, including the pro-government A Haber news channel, featured commentary about his move in their morning bulletins.
Meanwhile, pro-government newspapers harshly criticised Germany on their front pages on Monday, accusing the country of "fascism".
"Harsh response from Ozil against racism", said Sabah, while Milliyet went with: "Red card for racism."