A UK citizen suspected of being a militant Islamist has been acquitted by a Kenyan court of robbery with violence over an incident in 2008.
The prosecution had failed to prove its case against Jermaine Grant of east London, the court ruled.
He is due to appear again in a Kenyan court on 23 September on another set of terror-related charges.
Kenyan police allege he was linked to the widow of a suicide bomber involved in the July 2005 attacks in London.
Mr Grant has already served a two-and-half-year jail term for being in Kenya illegally.
Kiarie Wa Kiarie Magistrate
A gang, suspected to be made up of militants of the al-Qaeda-linked al-Shabab group, attacked the police station, freeing Mr Grant after he was arrested for trying to cross into Somalia, police alleged.
The gang allegedly stole four guns, stole a police vehicle and wounded a police officer during the attack.
The court ruled that the charges against Mr Grant had not been proven.
"The prosecution has failed to establish the case against him beyond reasonable doubt," magistrate Kiarie Wa Kiarie told the court.
Mr Grant, who remains in custody, is due to stand trial in the coastal city of Mombasa on 23 September after being accused of possessing explosive materials.
He denies the allegation.
Police allege that when they raided a house Mr Grant was staying in in 2011, they found ingredients needed to make a bomb – hydrogen peroxide and ammonium nitrate, as well as batteries and electrical switches.
Last year, Kenyan government prosecutor Jacob Ondari alleged that Mr Grant had worked with Samantha Lewthwaite, the widow of London Underground bomber Jermaine Lindsay, on a bomb plot.
Ms Lewthwaite is wanted by the Kenyan authorities and is alleged to be travelling on a forged passport.
Her husband blew himself up on a London Underground train on 7 July 2005, killing 26 people