Prime Minister Theresa May on Tuesday warned Turkish President Tayyip Erdogan not to go too far in his crackdown on those believed to be behind a failed 2016 coup attempt, speaking after a meeting in London marked by human rights protests.
Rights campaigners have accused May of turning a blind eye to human rights abuses in pursuit of trade deals after Brexit.
In Turkey's case they point to the jailing tens of thousands of people after the attempted coup. Erdogan's government has said its actions are necessary to combat the threat it faces.
May said Britain's relationship with Turkey was indispensable, praising the impact of security cooperation and the prospect of close post-Brexit trade ties.
But she added a diplomatic warning on the need for restraint.
"It is right that those who sought to overthrow the democratically elected government are brought to justice," May said, speaking alongside Erdogan in her Downing Street office following their meeting.
"But it is also important that in the defense of democracy, which has been facing extraordinary pressures from the failed coup, instability across the border from Syria and from Kurdish terrorism, Turkey does not lose sight of the values it is seeking to defend."
She said she had underlined the need for Turkey to uphold democratic values and its human rights obligations.
Erdogan's visit is part of May's charm offensive to shore up relations with countries outside the European Union as Britain prepares to leave the bloc and secure at least the promise of future trade deals to bolster her all but stalled Brexit plans.
Erdogan, the most popular - and divisive - politician in recent Turkish history, has ruled for 15 years, overseeing a period of sharp economic growth and a widespread crackdown against his opponents. Last month he declared snap elections for June 24, bringing the polls forward by more than a year.
Erdogan deflected a question from a British journalist about his country's ability to hold a free and fair election. He said those arrested in Turkey were being processed by the judiciary.
Just hours before the leaders were due to meet, around 100 protesters waved banners outside May's office depicting Erdogan as a puppet master with blood on his hands. Another said "tamam," or enough.
About 20 meters away, separated by barriers and a police cordon, a similar number waved Turkish flags in the direction of the anti-Erdogan protesters, chanted and played loud music.
The two sides briefly scuffled.
Last year, May secured a commitment for Britain and Turkey to work on post-Brexit trade.
Speaking on Tuesday, Erdogan welcomed a transition deal agreed between London and the EU to ease Britain's departure from the bloc. He said the two leaders had agreed trade could be increased to $20 billion annually, up from the 2017 level of around $16 billion.
Ties between the EU and Turkey are increasingly strained, with Brussels saying that Erdogan is leading his country away from the path to membership, while some Turkish officials say they feel betrayed by some of the bloc's leaders.