Germany's Mesut Ozil announced his retirement from international football Sunday at the age of 29, citing racism and lashing out at the president of the German football federation.

The Arsenal midfielder will not add to his 92 caps, 23 goals and 40 assists for his country following political tensions regarding his Turkish roots and being dropped from the starting XI during this summer's World Cup as the defending champions crashed out in the group stage.

Ozil was heavily criticised in Germany for his meeting with Turkey President Recep Tayyip Erdogan in May, when he and Ilkay Gundogan posed for a photo with the Turkish president during his visit to London.

The Arsenal midfielder finally broke his silence on the issue Sunday by posting a lengthy statement on social media insisting that he had done nothing wrong, before finally concluding that he was done playing for the German national team.

"It is with a heavy heart and after much consideration that because of recent events, I will no longer be playing for Germany at international level whilst I have this feeling of racism and disrespect," he wrote. "I used to wear the German shirt with such pride and excitement, but now I don't."

Born in Gelsenkirchen to Turkish parents, Ozil opted to play for Germany in November 2006 when invited by Turkey's FA to take part in a friendly against Italy, saying that he did "not plan to take on Turkish citizenship."

Ozil became a key player for Germany's golden generation, starting by winning the 2009 Under-21 European Championships, as Manuel Neuer, Jerome Boateng, Mats Hummels, Sami Khedira, Benedikt Howedes and Ozil became a core group in the senior team that went on to win the 2014 World Cup in Brazil.

Ozil made his senior debut for Germany in February 2009 and went on to become one of the stars of a revived German side at the 2010 World Cup, as the team finished third, starting in every match in South Africa.

He would then start in every game at a major tournament until Germany's 2-1 win against Sweden at the 2018 World Cup, which came after a 1-0 defeat to Mexico in the opening game, amid the ongoing row over his willingness to integrate into German society.

While Gundogan had explained his part in the Erdogan photograph in the lead-up to the World Cup, Ozil opted to remain silent on the issue, leading to political turmoil. The German football federation (DFB) has said the meeting was ill-advised, and Ozil's performances at the World Cup were also heavily scrutinised in the wake of the controversy.

And Ozil on Sunday defended his part in the photo, saying it wasn't about politics but about respecting the office of the presidency, adding that he believed his critics used the photo "as an opportunity to express their previously hidden racist tendencies."

"I'm aware that the picture of us caused a huge response in German media, and whilst some people may accuse me of lying or being deceitful, the picture we took had no political intensions," Ozil wrote. "For me, having a picture with President Erdogan wasn't about politics or elections, it was about me respecting the highest office of my family's country."

Mesut Ozil during Germany's World Cup defeat to Mexico in June 2018. Photo by Alexander Hassenstein/Getty Images

Earlier this month, the head of the German football federation, Reinhard Grindel, had said Ozil owed fans an explanation for his actions when he returned from his post-World Cup holiday. Ozil's statement was posted as Arsenal were preparing to fly to Singapore for a preseason tour, with Ozil having joined up with the squad just in time for the trip.

Ozil said the "mistreatment from the DFB, and in particular" Grindel was the issue that "frustrated" him the most. He accused Grindel of being "far more interested in speaking of his own political views and belittling my opinion" and said the federation turned him into "political propaganda."

"I will no longer stand for being a scapegoat for his incompetence and inability to do his job properly," Ozil wrote. "I know that [Grindel] wanted me out the team after the picture, and publicised his view on Twitter without any thinking or consultation, but [coach] Joachim Low and [director] Oliver Bierhoff stood up for me and backed me.

"In the eyes of Grindel and his supporters, I am German when we win, but I am an immigrant when we lose."

Ozil also criticised Grindel's past record as a member of Germany's Parliament, concluding: "People with racially discriminative backgrounds should not be allowed to work in the largest football federation in the world that has many players from dual-heritage families."

Ozil went on to list a number of honours he received for contributing to German society, and questioned why the public appeared reluctant to accept him.

"Are there criteria for being fully German that I do not fit?" he asked. "My friend Lukas Podolski and Miroslav Klose are never referred to as German-Polish, so why am I German-Turkish? Is it because it is Turkey? Is it because I'm a Muslim?"

The past couple of weeks have given me time to reflect, and time to think over the events of the last few months. Consequently, I want to share my thoughts and feelings about what has happened. pic.twitter.com/WpWrlHxx74 — Mesut Özil (@MesutOzil1088) July 22, 2018

In an earlier statement, Ozil said "the past couple of weeks have given me time to reflect" on the situation -- adding that having been born in Germany to a Turkish family means that "I have two hearts, one German and one Turkish."

And he explained that his mother taught him as a child to "never forget where I came from."

"Although the German media have portrayed something different, the truth is that not meeting with the President would have been disrespecting the roots of my ancestors, who I know would be proud of where I am today," his statement said. "For me it didn't matter who was President, it mattered that it was the President.

"Having respect for political office is a view that I'm sure both the Queen and Prime Minister Theresa May share when they too hosted Erdogan in London. Whether it had been the Turkish or the German President, my actions would have been no different."

Ozil went on to highlight the charity work he did while in Russia, which included paying for surgeries for 23 children -- a similar venture to one he undertook in Brazil during the 2014 World Cup.

He also said several of his commercial partners abandoned him during the media storm, including an unnamed charitable partner and his former school in Gelsenkirchen, who cancelled an event he was set to attend before the World Cup.

He also criticised Mercedes, which has a long-standing sponsorship deal with Ozil and the German football federation. The statement didn't mention the car-maker by name but made a scathing reference to the German government ordering the company to recall more than 200,000 vehicles because of unathorised software devices.

"I was renounced by another partner," Ozil wrote. "As they are also a sponsor of the DFB, I was asked to take part in promotional videos for the World Cup. Yet after my picture with President Erdogan, they took me out of the campaigns and cancelled all promotional activities that were scheduled. For them, it was no longer good to be seen with me, and called the situation 'crisis management.'

"This is all ironic because a German Ministry declared their products have illegal and unauthorized software devices in them, which puts customers at risk. ... Am I right in thinking this is worse than a picture with the President of my family's country? What does the DFB have to say about all this."