WASHINGTON — President Trump on Tuesday praised President Recep Tayyip Erdogan of Turkey as a stalwart ally in the battle against Islamic extremism, ignoring Mr. Erdogan’s authoritarian crackdown on his own people and brushing aside recent tensions between the United States and Turkey over how to wage the military campaign against the Islamic State.

Welcoming Mr. Erdogan to the White House, Mr. Trump said, “Today, we face a new enemy in the fight against terrorism, and again we seek to face this threat together.”

Mr. Trump said the United States supported Turkey’s battle against both the Islamic State and the P.K.K., a Kurdish militant group carrying out an insurgency inside Turkey. The Trump administration has decided to supply weapons to the Y.P.G., a Syrian Kurdish militia fighting alongside Syrian Arab forces against the Islamic State. That has caused tensions with Turkey, which says the Syrian Kurds are allied with the Turkish Kurds.