Andrew Brunson, the American pastor freed from prison in Turkey this week, prayed over Donald Trump at the White House on Saturday. In response, the president asked who Brunson and his wife had voted for in the presidential election that took place weeks after the pastor’s arrest in 2016.

Brunson, who said he voted by mail, and his wife, Norine, indicated they backed Trump. The president said he had known that already.

Minutes earlier, Brunson had kneeled, grasped Trump’s shoulder and asked God to grant the president “supernatural wisdom”.

“Make him a great blessing for this country,” Brunson said in the Oval Office, where he and his family gathered with Trump, administration officials including the secretary of state, Mike Pompeo, and the national security adviser, John Bolton, and Republican members of Congress.

“From a Turkish prison to the White House in 24 hours, that’s not bad,” Trump said.

Brunson, who moved to Turkey in the mid-1990s, was arrested and accused of having links to the Gülenist movement, which Turkey says orchestrated a failed 2016 military coup.

On Friday, a Turkish court sentenced Brunson to three years in jail but accounted for time served and suspended the rest of his sentence, making it possible for him to leave the country. Brunson’s lawyer, Jay Sekulow, is also a member of Trump’s legal team in the Russia inquiry.

On Saturday Brunson repeatedly thanked Trump, his staff and other government representatives. He and his wife will now spend some time with their children, he said, before praying for guidance. He declined to speak about his treatment in Turkey and said he would share that information in future interviews.

NBC reported on Thursday that the Trump administration had reached a deal for Brunson’s release and said the US was expected to ease economic pressure on Turkey.

Andrew Brunson and his wife walk with Donald Trump. Photograph: Roberto Schmidt/AFP/Getty Images

Trump denied that and said the only thing close to a deal “was a psychological one”, explaining that Brunson’s return had improved US feelings towards Turkey.

The two countries remain divided on key issues such as Iran and the civil war in Syria. Before Brunson’s hearing on Friday, Turkish president Recep Tayyip Erdoğan said he was disappointment that US-backed Kurdish militias have not left the Syrian town of Manbij, contrary to an agreement brokered this year.

Trump spoke about Americans released from captivity overseas under his administration, including Aya Hijazi, who was imprisoned in Egypt for three years, and three men released from North Korea in May.

“Chairman Kim [Jong-un] was really great to us,” he said. He added: “It’s not an easy situation for Turkey either. They had a lot of difficult situations going on and I do want to thank President Erdoğan for making this possible.”

Trump also faced questions about the disappearance of the journalist Jamal Khashoggi after entering Saudi Arabia’s consulate in Istanbul earlier this month.

Some analysts have suggested there is a connection between the timing of Brunson’s release and the search for information on Khashoggi’s disappearance. Trump said Brunson’s release was a “total coincidence”.