Donald Trump’s speech on Monday was advertised as an attempt to redirect his campaign from a series of blunders to a more serious discussion of foreign policy, starting with combating global terrorism. As such, it marked another test of his readiness to lead. It did not go well.

Far from coherent analysis of the threat of Islamic extremism and a plausible blueprint for action, the speech was a collection of confused and random thoughts that showed little understanding of the rise of the Islamic State and often conflicted with the historical record.

Meanwhile, with terrorism as his central focus, Mr. Trump doubled down on the anti-refugee themes that have dominated his campaign, dressing them up as a national security issue. He proposed a new “extreme vetting” approach to immigration that would impose an ideological test on newcomers and undermine the very American values of tolerance and equal treatment that he said he wanted to encourage. He also called for the creation of a commission that would “expose the networks in our society that support radicalization,” which struck many listeners as an uncomfortable echo of McCarthyism.

There are, of course, reasons to criticize President Obama and Hillary Clinton, the Democratic nominee and Mr. Obama’s former secretary of state, for their handling of the Middle East. They dropped the ball in Libya after Col. Muammar el-Qaddafi was ousted, and their ill-defined strategy in Syria has generated many legitimate questions.