The prime minister was speaking to reporters while on a visit to a medical centre in London on Monday, some 24 hours after one man died and a second was injured following the blast on Remembrance Sunday.
Mr Johnson said he could not comment on specific details because the investigation is ongoing but praised the taxi driver, who has been named locally as David Perry.
"It does look as though the taxi driver in question did behave with incredible presence of mind and bravery," Mr Johnson said.
Mr Perry "managed to [avert] what could have been an absolutely awful disaster," Liverpool City mayor Joanne Anderson told the BBC.
"Our thanks go to him and our emergency services,” she added.
Mr Perry was treated in hospital for his injuries and has now been discharged.
Three men - aged 29, 26 and 21 - have been arrested under the Terrorism Act. They were detained in the nearby Kensington area of the city, while residents were evacuated as armed police were seen in Rutland Avenue, in the Sefton Park area, until the early hours of the morning.
A fourth suspect was arrested in connection with the bombing on Monday morning.
The blast has was declared a terrorist incident on Monday but police say the motive remains unclear.
Assistant Chief Constable Russ Jackson, from Counter-Terrorism Policing for the North West, said the man who died in the blast brought a homemade bomb with him into a taxi and asked to be taken to Liverpool Women's Hospital.
He was picked up in the Rutland Avenue area of the city and taken to the hospital shortly before 11am on Sunday.
Mr Jackson told reporters: "Our inquiries indicate that an improvised explosive device has been manufactured and our assumption so far is that this was built by the passenger in the taxi.
"The reason why he then took it to the women's hospital is unknown, as is the reason for its sudden explosion.
"We are of course aware that there were Remembrance events just a short distance away from the hospital and that the ignition occurred shortly before 11am.
"We cannot at this time draw any connection with this but it is a line of inquiry we are pursuing.
"Although the motivation for this incident is yet to be understood, given all the circumstances it has been declared a terrorist incident and counter-terrorism policing are continuing with the investigation."
He told journalists that police know the identity of the attacker but will not confirm it at this stage.
Register for free to continue reading
Registration is a free and easy way to support our truly independent journalism
By registering, you will also enjoy limited access to Premium articles, exclusive newsletters, commenting, and virtual events with our leading journalists
Already have an account? sign in