A homemade bomb planted on a rush-hour subway car exploded in London on Friday, injuring 29 people and prompting authorities to raise Britain's terrorism threat level to "critical," meaning another attack may be imminent.

The early morning blast sparked a huge manhunt for the perpetrators of the fifth terrorist attack in the British capital this year.

Prime Minister Theresa May, acting on the recommendation of the Joint Terrorism Analysis Centre, raised the country's threat level from "severe" to "critical" — its highest possible level. May said military troops would augment the police presence in a "proportionate and sensible step."

Witness: 'There were just layers and layers of people screaming' 1:40

Earlier, May said the device had been "intended to cause significant harm."

Still, to the relief of authorities and Londoners, experts said the bomb — hidden in a plastic bucket inside a supermarket freezer bag — only partially exploded, sparing much worse carnage.

"I would say this was a failed high-explosive device," Chris Hunter, a former British army bomb expert, said of the blast, which caused no serious injuries.

In this image made from video, fire comes from a homemade bomb in a bucket inside a train at a subway station in southwest London on Friday morning. ( @RRIGS/Associated Press)

ISIS claimed responsibility for the attack, which it said was carried out by an affiliated unit.

The bomb went off around 8:20 a.m. as the train, carrying commuters from the suburbs — including many schoolchildren — was at Parsons Green station in the southwest of the city.

Richard Aylmer-Hall discusses what he calls "pure carnage" after a blast went off during his morning commute with CBC News Network's Carole MacNeil. 4:21

Witness Chris Wildish told CBC Radio's As It Happens there was a moment of calm, "and then it was chaos. It was people climbing over seats and over others, and shouting and screaming, just trying to get away from the device."

"I just saw out of the corner of my eyes, there was a flash of light," said Wildish, who was in an adjacent train car from where the explosion occurred.

"And as I looked over, there was a flash of flame that shot kind of from the floor up into the roof of the train, and then very quickly followed by a very strong smell of chemicals."

Reactions from Theresa May, Sadiq Khan, Donald Trump 1:07

Commuter Lauren Hubbard said she was on the train when she heard a loud bang.

"I looked around and this wall of fire was just coming toward us," Hubbard said. She said her instinct was "just run," and she fled the above-ground station with her boyfriend.

'Lots of shouting and screaming'

Chaos ensued as hundreds of people, some of them suffering burns, poured from the train, which can hold up to 800 people.

Commuter Richard Aylmer-Hall said he saw several people injured, apparently trampled as they fled.

"I saw crying women, there was lots of shouting and screaming, there was a bit of a crush on the stairs going down to the streets," Aylmer-Hall, said.

Police and health officials said 29 people were treated in London hospitals, most of them for flash burns. None of the injuries were serious or life-threatening, the emergency services said.

The Metropolitan Police said hundreds of detectives, along with agents of the domestic spy agency MI5, were looking at surveillance camera footage, carrying out forensic work and speaking to witnesses.

Forensic investigators search on the platform at Parsons Green tube station in London on Friday. (Hannah McKay/Reuters)

Among questions they were rushing to answer: What was the device made from, and was it meant to go off when it did, in a leafy, affluent part of the city far from London's top tourist sites?

Friday's attack involved the "detonation of an improvised explosive device," said Mark Rowley, head of counterterrorism for the Metropolitan Police.

Not a suicide attack

British media reported that the bomb included a timer. Lewis Herrington, a terrorism expert at Loughborough University, said that would set it apart from suicide attacks like those on the London subway in 2005 or at Manchester Arena in May, in which the attackers "all wanted to die."

Photos taken inside the train showed a white plastic bucket inside a foil-lined shopping bag, with flames and what appeared to be wires emerging from the top.

Terrorism analyst Magnus Ranstorp of the Swedish Defence University said that from the photos it appeared the bomb did not fully detonate, as much of the device and its casing remained intact.

"They were really lucky with this one, it could have really become much worse," he said.

Hunter, the explosives expert, said it appeared that "there was a bang, a bit of a flash, and that would suggest that, potentially, some of the explosive detonated, the detonator detonated, but much of the explosive was effectively inert."

London Met Police treating Tube fire as terrorist incident. A sense of the injuries: woman emerges from scene with her head bandaged <a href="https://twitter.com/hashtag/cbc?src=hash">#cbc</a> <a href="https://t.co/p7tQDVlx6t">pic.twitter.com/p7tQDVlx6t</a> —@thomasdaigle

Police and ambulances were on the scene within minutes of the blast, a testament to their experience at responding to violent attacks in London.

In its recent Inspire magazine, al-Qaeda urged supporters to target trains.

'Chasing down suspects'

Rowley said officers were sifting through surveillance footage and examining the remains of the device. "This is a very complex investigation which is continuing at speed," he told reporters. "We are chasing down suspects."

British police have investigated five other attacks this year, which killed a total of 36 people. The other attacks in London were on Westminster Bridge and near Parliament, on London Bridge, near a mosque in Finsbury Park in north London and outside Buckingham Palace. Another attack took place in Manchester on May 22.

British authorities say they have foiled 19 plots since the middle of 2013, six of them since the van and knife attack on Westminster Bridge and Parliament in March. Police and MI5 say that at any given time they are running about 500 counterterrorism investigations involving 3,000 individuals.

London Mayor Sadiq Khan said there had been a "shift" in the terrorism threat, with attackers using a wide range of methods to try to inflict carnage. Khan, who belongs to the opposition Labour Party, said London police needed more resources to fight the threat. Police budgets have been cut since 2010 by Britain's Conservative government.

.<a href="https://twitter.com/metpoliceuk">@metpoliceuk</a> have confirmed that the explosion on a train at Parsons Green Station is being treated as terrorism. <a href="https://t.co/dKZCcjEZjT">https://t.co/dKZCcjEZjT</a> <a href="https://t.co/fFzOf6wNXu">pic.twitter.com/fFzOf6wNXu</a> —@MayorofLondon

London Underground often targeted

The London Underground, which handles five million journeys a day, has been targeted several times in the past. In July 2005, suicide bombers blew themselves up on three subway trains and a bus, killing 52 people and themselves. Four more bombers tried a similar attack two weeks later, but their devices failed to fully explode.

Last year Damon Smith, a student with an interest in weapons and Islamic extremism, left a knapsack filled with explosives and ball bearings on a London subway train. It failed to explode.

U.S. President Donald Trump weighed in on Friday's attack, tweeting that it was carried out "by a loser terrorist," and adding that "these are sick and demented people who were in the sights of Scotland Yard."

The British prime minister gently rebuked the president for his tweets.

"I never think it's helpful for anybody to speculate on what is an ongoing investigation," May said.

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! —@realDonaldTrump