BEIRUT—Radical Islamists on Monday sought to harness U.S. President Donald Trump’s immigration and refugee bans to their narrative that the U.S. is at war with Islam, underpinning fears among some foreign and U.S. lawmakers and diplomats that the actions could fuel rather than prevent violence.

“What Trump has done has clearly revealed the truth and harsh reality behind the American government’s hatred towards Muslims,” wrote a jihadist on Telegram, an encrypted service extremists use to communicate with one another.

...