A month before he was dismissed from the Trump administration, then-Secretary of State Rex Tillerson passed through Ankara to visit Turkey’s strongman, Recep Tayyip Erdogan. They met for three hours at Erdogan’s palace, with the Turkish foreign minister providing translation services.

We can only guess what the two men talked about, for neither side had note-takers or their respective ambassadors in the room. One can assume Erdogan complained about Washington’s support for Syrian Kurds; about Washington’s failure to extradite his nemesis, Fethullah Gulen (whom Ankara accuses of being behind the 2016 coup attempt); and of course about a possible move by Congress to slap Turkey with sanctions for the purchase of Russian weapon systems or the imprisonment of U.S. citizens.

This is what Erdogan does so well — shifting the power balance in the room by scolding the other side — and it is hard to imagine that Tillerson, as a former oil-company executive accustomed to securing deals with strong-willed Middle Eastern leaders, pushed back. After all, the Trump administration has long felt the need to repair relations with its NATO ally but has somehow made everything worse with its inept handling of its Syrian Kurdish partners and Turkey.

Even before Tillerson’s arrival, Erdogan was threatening to deliver “an Ottoman slap” to the U.S. Special Forces soldiers serving alongside Syrian Kurds at a little-known town called Manbij. Tillerson didn’t seem to mind.

Tillerson’s visit to Ankara prompted the formation of several working groups with Turkish and U.S. officials to address bilateral problems. After their first meeting in Washington, Turkish officials said the United States had agreed to kick Syrian Kurds out of Manbij. The State Department denied it — even though privately its diplomats enthusiastically support the idea of handing Manbij to Ankara, and a deal with Turkey.

There is nothing wrong with striking a deal with Ankara. Tillerson did the right thing by trying to engage Turkey. But at what price?

Manbij has long been a flashpoint in the Turkish-Kurdish conflict that has now sprawled into Syria. But surely the control of a dusty little Syrian city is not the only issue between Ankara and Washington. Turkish leaders now talk about an open-ended war against Syria’s Kurds, whom Ankara considers “terrorists,” “all the way up to the Iraq border,” according to the Turkish president. And what was Tillerson’s response to that?

Possible sanctions, U.S. collaboration with Syrian Kurds and an upcoming U.S. Treasury fine on Turkish banks that have circumvented the international embargo on Iran probably all came up in the conversation. So, too, almost certainly, did the fate of jailed U.S. citizens such as Pastor Andrew Brunson, who has been held on phantasmagorical charges for the past 500 days. Ankara sees him a bargaining chip.

I doubt, however, that the dismal state of Turkish democracy featured prominently on Tillerson’s agenda. U.S. officials have a ritualized way of dealing with global autocrats — human rights usually appear rather far down on the shopping list. U.S. officials have their talking points, and autocrats already have their replies ready. Once the lines are uttered, nothing changes.

No doubt this is what happened with Tillerson. The danger has always been that Washington will go from one extreme to the other — from tough talk of sanctions and a brief visa ban in December to a policy of total appeasement, as Erdogan threatens to dismantle whatever remains of Turkish democracy.

When it comes to dealing with Turkey, the Trump administration needs to strike a balance between realpolitik and the long-term need to prevent the erosion of Turkey’s democracy under Erdogan’s authoritarianism. To think that it is a good idea for America to settle on a transactional deal with Turkey’s strongman while ignoring his assault on institutions dedicated to pluralism and secularism is a terrible mistake. Turkey remains polarized, and a significant portion of its population – at least half, according to the results of last year’s constitutional referendum – is unhappy with this backsliding. U.S. interests lie in preserving Turkey as a stable pro-Western society. That can be achieved only by a return to the rule of law.

Incoming Secretary of State Mike Pompeo should take a longer view. Abandonment is not an option; doing business with Erdogan is important and necessary. But so is the need to find a level of engagement that combines collaboration with tough measures — ones that that force the Turkish leader to ease up on dissent. Just as Berlin appears to be doing, Washington should regard the release of imprisoned U.S. citizens and Turkish journalists, and the lifting of Turkey’s state of emergency as benchmarks for specific steps aimed at improvement of relations. The ultimate goal should be ushering in Turkey’s return to democracy – a key component of which would have to be the resumption of Turkish-Kurdish peace accord.

Turkey was once the poster child of a Muslim democracy. Now it has slipped into hyper-nationalism that threatens its own stability – and that of the region.

So a note to the incoming secretary of state: By all means, do deals with Erdogan — but not at the expense of our democracy.