ANKARA, Turkey (AP) — Former U.S. Sen. Jeff Flake formally stepped into his new position as U.S. ambassador to Turkey on Wednesday, after presenting his credentials to Turkish President Recep Tayyip Erdogan.

Flake is a former Republican lawmaker who endorsed U.S. President Joe Biden’s 2020 run for the White House. He served in the U.S. Senate from Arizona from 2013 to 2019 and in the U.S. House of Representatives from 2001 to 2013.

He takes up the position at a difficult time for U.S.-Turkish relations. The long list of disagreements between the two NATO allies includes a rift over U.S. support for Kurdish fighters in Syria as well as Turkey’s purchase of a Russian weapons system.

His appointment also comes amid threats of sanctions against Russia by the United States and its allies over concerns that Russia may be planning to invade Ukraine. Turkey enjoys close relations with both Ukraine and Russia and has offered to mediate between the two.

“It is an honor to represent the United States in Turkey. This is a critical relationship at a pivotal time,” Flake wrote on Twitter.

Video footage released by Erdogan’s office showed Flake handing over his diplomatic credentials to the Turkish leader before they posed for photographs.

Flake replaces Ambassador David Satterfield, who was appointed the U.S. special envoy to the Horn of Africa.

Last year, Erdogan threatened to oust Satterfield and nine other Western ambassadors after they called for the release of philanthropist Osman Kavala, who has been in a Turkish prison for four years awaiting trial on charges many view as unfounded. A diplomatic crisis was averted after the U.S. Embassy in Ankara declared compliance with a convention outlining diplomats’ duties to respect the laws of the host state and not to interfere in internal affairs. Other missions posted the same message.

Flake retired from the Senate at the end of his term in 2019, saying he was out of step with the Republican Party in the era of former President Donald Trump. He later wrote a book, “Conscience of a Conservative,” that was a critique of Trump.