Turkey is a NATO member with substantial armed forces. It has the potential to stabilize or further destabilize the Middle East. And last year, it imported $9.4 billion worth of American goods.

In a word, it is an ally.

Real American interests justify President Trump's personal effort to win the trust of his Turkish counterpart, Recep Tayyip Erdogan.

President Erdogan, however, has imprisoned hundreds of journalists, purged thousands of independent judges, and has spent upwards of $600 million building himself a 1,150 room palace full of the self-aggrandizing chic of the sort once favored by Saddam Hussein.

He an authoritarian zealot.

That combination — an ally led by a tyrant — means Trump needs to handle America's relationship with Turkey more deftly than he has done so far.

Meeting with Erdogan this week, Trump said "It's a great honor and privilege because he's become a friend of mine, to introduce President Erdogan ... he's getting very high marks."

This grates not only because of Erdogan's illiberal behavior at home but because of his flouting liberal principles and the rule of law right here in the U.S.

Trump should stop singing Erdogan's praise and instead condemn Thursday's attacks by Erdogan's supporters and bodyguards on protesters at an event in New York City.

Video from that Turkish-American forum indicates that while Erdogan's civilian supporters were the main perpetrators of violence, the president's security detail was also culpable, and not for the first time. While this is unprofessional — security details are supposed to remain with their protectee and allow private security to remove protesters — it is standard fare for the Turkish presidential security service, which has a long record of attacking peaceful protesters. As recently as in May, Turkish security officers beat American citizens outside the Turkish Embassy in Washington, D.C.

It is increasingly clear that Erdogan revels in such scenes. He does not tolerate dissent at home or abroad. As Americans were beaten up on Thursday, Erdogan had the temerity to describe them as "impertinent hall terrorists."

By his repeated acts and his support of extrajudicial violence, Erdogan shows he has no respect for American law and custom, or for this nation's sovereignty, which Trump extolled at the UN General Assembly.

Unfortunately, Trump has not yet confronted Erdogan over this. By failing to condemn violence against peaceful protesters on American soil, Trump fails in his duty to protect the rights of peaceful assembly and petition, as he swore to do on Inauguration Day.

Trump also gives the impression of weakness. As we noted this week, his realist foreign policy strikes a praiseworthy balance of interests and internationalism. But realist leadership will achieve little if he allows Americans to be attacked by foreign security services here at home. What inference should be taken by Vladimir Putin, Xi Jinping, and Ali Khamenei? What are despots to conclude after witnessing such a lackadaisical response the Turks' outrage?

Realism does not demand that Trump use force against all who fall short of American ideals, or repudiate them, but it does demand that he candidly condemn those governments that commit grievous abuses (as he did at the UN, calling out Venezuelan dictator Nicolas Maduro).

Foreign policy friendships are important, but so is the presidential obligation to preserve, protect and defend the Constitution. When a foreign government believes it can with impunity beat up peaceful protestors on U.S. soil, it erodes American sovereignty. Trump can hardly abide such a thing without damaging a central tenet of his own presidency.