Image copyright AFP/Getty Image caption US pastor Andrew Brunson cannot leave the country and must wear an ankle bracelet

US President Donald Trump and Vice-President Mike Pence have threatened Turkey with sanctions if it fails to release jailed pastor Andrew Brunson.

The evangelical from North Carolina has been in detention for nearly two years, accused of having links to banned political groups.

However, President Trump demanded his immediate release, or Turkey, a Nato ally, would face "large sanctions".

The Turkish foreign ministry called the US demands "unacceptable".

"No-one can give orders to Turkey and threaten our country," said spokesperson Hami Aksoy.

Who is Andrew Brunson?

He is a long-term resident in Turkey. He lived with his wife and three children while working as the pastor of the small Izmir Resurrection Church, which had a congregation of about two dozen Protestants.

The authorities accuse him of having links with the outlawed Kurdistan Workers' Party (PKK) and the Gulenist movement, which Turkey blames for a 2016 failed coup.

Mr Brunson has denied charges of espionage, but faces up to 35 years in jail if found guilty.

He was moved into house arrest on Wednesday for health reasons, but US Secretary of State Mike Pompeo said this was not enough.

"We have seen no credible evidence against Mr Brunson," Mr Pompeo tweeted on Wednesday.

Turkey's foreign ministry said it had shared "necessary information" with the US, but insisted the case should be left with its independent judiciary.

Why is the US speaking out?

Mr Pence also sent out a series of strongly worded tweets, saying Turkey must act immediately or "be prepared to face the consequences".

The vice-president, who is himself an evangelical Christian, attended the global summit on religious freedom at the state department on Thursday, which is thought to have sparked the outburst.

Mr Pompeo, who is also an evangelical, hosted the summit - the first of its kind to be held at the state department.

Sanctioning a Nato ally would be an unprecedented move, but this is not the first time the idea has been mentioned.

In June, US diplomats also spoke about possible sanctions against Turkey, but related to its purchase of anti-aircraft missiles from Russia.

Analysts say this could still be an underlying motivation for the latest threat.

However, President Trump has repeatedly called for the return of captive Americans. He made a specific stand with North Korea, and three detainees were released in May ahead of his summit with leader Kim Jong-un.

It is thought standing up for a pastor will be appreciated by his Christian supporters.

US Ambassador-at-Large for International Religious Freedom Sam Brownback said he believes there is an "excellent prospect" that Mr Brunson will come home.

"It has been raised with Turkey for some months now, in many forms, at every level of government," he said.

What is Turkey's motivation?

Mr Brunson is one of 20 Americans who were charged after the coup, according to the New York Times.

More than 50,000 people were arrested in Turkey in President Recep Tayyip Erdogan's huge post-coup crackdown.

He blames Pennsylvania-based Muslim cleric Fethullah Gulen for the attempt, but Mr Gulen denies any involvement.

Turkey wants the US to agree to his extradition. President Erdogan has indicated he would swap the pastor for "the priest" (Mr Gulen).

US support for Kurdish forces fighting the Syrian civil war has also angered President Erdogan, who views them as an extension of the PKK.

The PKK - a Turkish-Kurdish rebel group fighting for autonomy since the 1980s - is considered a terrorist group by Turkey and the US.