An American pastor held for two years in Turkey on terrorism-related charges returned to the United States on Saturday, CNN reported. He met with President Donald Trump after he arrived in Washington.

The Turkish government detained pastor Andrew Brunson in October 2016 during a crackdown after a failed coup attempt three months earlier. He was accused of helping plot the coup attempt. On Friday, a court convicted Brunson on charges of espionage and aiding terror groups, and sentenced him to three years, one month and 15 days in jail. However, the court released him based on time served and good behaviour, reported AFP.

Brunson has maintained he was innocent and Trump administration officials have previously said the charges were politically motivated. The pastor’s detention had led to a diplomatic crisis between the two countries.

On Saturday, Trump said Brunson’s release was a “tremendous step” towards improved relations with Turkey, but he denied cutting a deal with Ankara. “There was no deal made with Turkey for the release and return of Pastor Andrew Brunson,” the president tweeted.

“The only deal, if you could call it a deal, is a psychological one,” Trump said, according to Reuters. “We feel much differently about Turkey today than we did yesterday, and I think we have a chance of really becoming much closer to Turkey.”

The pastor’s release may lead to easing in tensions between Turkey and the US, which had worsened in August after a deal to free Brunson fell apart. Trump then imposed double duties on aluminium and steel imported from Turkey, which led to a slump in the value of lira against the dollar. The lira’s decline hit several other emerging market currencies, including the Indian rupee, hard.

Trump did not pledge to lift the sanctions but said he welcomed an end to the “harsh relationship” the countries had over the past two months.

Trump also thanked Turkish President Recep Tayyip Erdogan for facilitating Brunson’s return. Erdogan responded to Trump, saying this will lead “to good, perhaps great, relations” between the two countries. “I hope that the United States and Turkey continue cooperation in a manner that befits two allies,” AFP quoted Erdogan as saying.