BERLIN — Mesut Ozil, the German soccer star who quit the national team last year after a photograph of him posing with the Turkish president unleashed a political storm, married a former Miss Turkey on Friday on the banks of the Bosporus.

His best man? President Recep Tayyip Erdogan of Turkey.

Mr. Ozil, who has Turkish roots, said in March that he had asked Mr. Erdogan to be his best man. In Germany, the decision was immediately criticized as “irresponsible” and “disappointing.” Many pointed to the furor last year after the athlete posed for a picture with Mr. Erdogan, who was running for re-election at the time.

But Mr. Erdogan and his wife, Emine Erdogan, attended the ceremony on Friday and took photographs with the bride and groom. The president also gave a speech denouncing birth control.

Born in Germany to immigrants from Turkey, Mr. Ozil became one of Germany’s most popular soccer stars. Many saw him as a symbol of modern German soccer and, by extension, a more diverse nation. But he abruptly quit the national team in the face of harsh criticism, first over his meeting with Mr. Erdogan and then for his performance in Germany’s embarrassing early exit from the 2018 World Cup.