President Donald Trump called Friday for a “tougher and more specific” U.S. travel ban after a homemade bomb exploded on a London train.

In a flurry of early-morning tweets, Mr. Trump called the explosion another attack “by a loser terrorist” and suggested London police missed an opportunity to prevent it. He added that his travel ban targeting six mostly Muslim nations should be “far larger, tougher and more specific — but stupidly, that would not be politically correct!”

The bomb exploded on a packed train during rush hour on Friday, leaving at least 22 people injured but no one seriously hurt. Police said the explosion was a terrorist attack, the fifth in Britain this year.

“Another attack in London by a loser terrorist,” Mr. Trump tweeted. “These are sick and demented people who were in the sights of Scotland Yard. Must be proactive!”

Scotland Yard said it would not comment Mr. Trump’s suggestion that police could have prevented the attack. The White House did not immediately respond to questions about whether the president had been briefed on the incident.

Mr. Trump’s tough talk came a day after he drew conservative criticism for pursuing an agreement with Democrats on young immigrants who had been living in the country illegally that would delay funding for his long-promised border wall. Mr. Trump said on Thursday he was “fairly close” to an agreement that could protect the “dreamers” while also adding border security, as long as his wall with Mexico was also separately addressed.

The President has repeatedly criticised London Mayor Sadiq Khan, the British capital’s first Muslim leader.

In June, after attacks in the London Bridge area that claimed seven lives, Mr. Khan warned locals not to be alarmed by the large presence of armed officers on the capital’s streets. Mr. Trump accused the mayor on Twitter of suggesting there was “no reason to be alarmed” by the attack itself.

On Friday, Mr. Trump again jumped into the fray, promoting his record against extremist militants and saying the government should cut of the internet to such groups.

“Loser terrorists must be dealt with in a much tougher manner. The internet is their main recruitment tool which we must cut off & use better!” And he argued that his administration has “made more progress in the last nine months against ISIS than the Obama Administration has made in 8 years.”

Mr. Trump concluded- “Must be proactive & nasty!”

The travel ban has been ensnared in the courts since Mr. Trump’s first attempt to enact the policy in January. The Supreme Court is scheduled to hear arguments on Oct. 10 on the legality of the bans on travelers from six mostly Muslim countries and refugees anywhere in the world.

It’s unclear, though, what will be left for the court to decide. The 90-day travel ban on visitors from Iran, Libya, Somalia, Sudan, Syria and Yemen lapses in late September, and the 120-day refugee ban will expire a month later. The administration has yet to say whether it will seek to renew the bans, make them permanent or expand the travel ban to other countries.