Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump on Friday said he wished his ban on travelers entering the U.S. was stronger, just hours after more than 20 people were injured in an attack on a London subway train that British police were treating as a terrorist incident.

"Another attack in London by a loser terrorist. These are sick and demented people who were in the sights of Scotland Yard. Must be proactive!" Trump tweeted in the first of four posts about the incident.

"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!" he added.

The president then expressed interest in more measures for entering the United States. "The travel ban into the United States should be far larger, tougher and more specific — but stupidly, that would not be politically correct!" he wrote.

"We have made more progress in the last nine months against ISIS than the Obama Administration has made in 8 years. Must be proactive & nasty!" Trump tweeted.

The tweets came as police in London investigated a rush-hour fire aboard a subway train in the British capital as terrorism, but before authorities had confirmed other pertinent information.

Authorities said 22 people were injured at the Parsons Green Tube station in southwest London. None of their wounds were considered serious or life-threatening.

Members of the London Fire Brigade stand by cordon near Parsons Green tube station in London on Sept. 15. Hannah McKay / Reuters

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Neil Basu, the Metropolitan Police's deputy assistant commissioner and senior national coordinator for counterterrorism policing, said the blaze was being treated as a "terrorist incident" and investigators were examining the remains of an improvised explosive device.

In brief remarks to reporters, Trump called what happened in London "a terrible thing."

"Just keeps going and going, and we have to be very smart," he added. "We have to be very, very tough, which perhaps we're not nearly tough enough."

Trump calling out the attack's perpetrators on Twitter as having been under the nose of Scotland Yard was noted as unhelpful by Prime Minister Teresa May.

But National Security Advisoe H.R. McMaster saw Trump's tweets as communicating that "all of our law enforcement efforts are focused on this terrorist threat from you know — for years. Scotland Yard has been a leader, as our FBI has been a leader. So, so I think if there was a terrorist attack here, God forbid, that we would say that they were in sights of the FBI. So I think he didn’t mean anything beyond that."

Trump's earlier tweetstorm Friday wasn’t the first time he'd quickly turned to social media to tout his ban after an apparent terrorist attack.

In June, after a terror attack in London left seven dead and nearly 50 injured, Trump tweeted that the ban was needed for “an extra level of safety."

“We need to be smart, vigilant and tough. We need the courts to give us back our rights. We need the Travel Ban as an extra level of safety!” he wrote on June 3.

Trump also tweeted criticism of London Mayor Sadiq Khan, who responded by saying Trump was wrong and should not make a state visit.

Trump has repeatedly pointed to his travel ban as a cornerstone of his counterterrorism platform.

Under the order, foreign nationals are banned for 90 days from six majority-Muslim countries — Iran, Syria, Sudan, Somalia, Libya and Yemen — and refugees lacking a link to the U.S. are barred for 120 days.

After several court setbacks, the Supreme Court in late June allowed the administration to reinstate most of the ban.

And this week, the Supreme Court agreed to maintain the temporary ban on travel to America by refugees, after the Trump administration urged the court to act quickly to keep the refugee ban in place. But the government gave up fighting over whether grandmothers and other relatives should also be subject to the ban.

The Trump administration and groups challenging the travel ban are preparing for a Supreme Court showdown on Oct. 10 on whether the president had the authority to impose his executive order in the first place. But because the visa ban expires in late September, and the refugee ban lapses in late October, the entire case could collapse before the justices hear courtroom arguments.

Over a dozen security and immigration experts and former government officials surveyed by NBC News have said there is scant evidence that the ban is strengthening national security or laying the foundation for more long-term reforms to immigration vetting.

Adam Edelman reported from New York City and Ali Vitali from Washington, D.C.