2014 World Cup winner Mesut Özil has retired from international soccer, citing racism as his reason for bowing out of the German national side.

Alexander Hassenstein / Getty Images

In a series of tweets accompanied by a statement, the 29-year-old midfielder opened up about the challenges he had faced while playing for Germany largely in response to a controversial photo taken back in May.

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. https://t.co/WpWrlHxx74

Özil, who is of Turkish origin but was born in Germany, posed for a photo with the president of Turkey, Recep Tayyip Erdogan, just before the Turkish presidential elections, while attending a charity event in London.

Anadolu Agency / Getty Images

Soccer players Ilkay Gundogan (left), Mesut Özil (second from the left), and Cenk Tosun (right) pose for a photo with President Erdogan.

The photo received backlash from German media who questioned Özil's loyalty to the country, while the president of the German Football Association (DFB), Reinhard Grindel, said that “football and the DFB stand for values that Mr Erdogan does not respect. That's why it's not acceptable that our national team players are exploited for his election campaign.”

Özil addressed the photo in the statement he tweeted Sunday.

Lars Baron - Fifa / Getty Images

Özil won the World Cup with Germany in Brazil in 2014.

"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," he wrote.

"Whether it had been the Turkish or the German President, my actions would’ve been no different."

The DFB responded to Özil's departure with a statement in which it denied all racism allegations, insisting that it is an institution committed to "integration" and "diversity."

The statement noted that the DFB is involved in several projects to integrate "tens of thousands" of refugees into the sport, and could not let the comments made by Özil go unchallenged.

Özil's decision to quit the national team has prompted responses from a number of high-ranking figures including German Chancellor Angela Merkel, who said to "respect" his choice and thanked him for his services to the German national team.

"Özil's photo remains wrong & his explanation is not convincing. At least as disastrous is the action of the DFB head. #Grindel hacks up our history of integration. Do they want to see young German Turks playing for Erdogan soon? DFB needs a fresh start #özil"

"That those affected could simply be right when they talk about exclusion, racism, violence and discrimination is apparently still unthinkable for many white Germans. It cannot stay that way, people. #Ozil."

Surreal that someone who has done so much for his country on and off the pitch has been treated with such disrespect. Well done @MesutOzil1088 for standing up to this behaviour! https://t.co/w1dvWOHFYN