Image caption Ahmed Khalfan Ghailani, a native of Tanzania, was arrested in 2004

The judge in the first civilian trial of a former Guantanamo inmate has ruled that a key US government witness cannot testify, in a blow to prosecutors.

Defendant Ahmed Khalfan Ghailani denies helping al-Qaeda kill 224 people in the 1998 US embassy bombings in Africa.

The judge ruled the witness could not testify as he had been named by Mr Ghailani while he was "under duress".

A BBC correspondent says the move complicates plans to try Guantanamo detainees in civilian courts.

The Obama administration is hoping to hold such trials for a number of high-profile inmates, including alleged 9/11 mastermind Khalid Sheikh Mohammed.

New York Judge Lewis Kaplan postponed Mr Ghailani's trial, which had been due to begin on Wednesday.

It is now due to open with jury selection on 12 October.

In his ruling, the judge said the proposed government witness had been identified during "statements made by Ghailani to the CIA under duress".

The man, Hussein Abebe, was expected to testify that he had sold TNT used in the bombing of the US embassy Tanzania in August 1998 to Mr Ghailani.

A US prosecutor had described Mr Abebe as a "giant" witness for the government, which is considering whether to appeal against the ruling.

Test case

Analysis Prosecutors argued that Hussein Abebe, who claims to have sold Ahmed Khalfan Ghailani the explosives used in the Tanzania bombing, was a willing witness who was eager to testify. They also contended that Mr Abebe would have been found without Mr Ghailani's confessions. Judge Kaplan disagreed, arguing that the government had failed to prove that Mr Abebe's testimony would be sufficiently removed from Ghailani's allegedly coerced statements, thus rendering his testimony unconstitutional. The decision is not only a major blow to the government's case - prosecutors had called him a "giant" witness who could illustrate that Mr Ghailani was not the clueless participant in the bombings he claimed to be - but it may also have implications for how future cases, based on information gleaned at Guantanamo, are mounted.

Defence lawyer Peter Quijano praised the ruling, saying the US Constitution "won a great victory today".

"This case will be tried upon lawful evidence - not torture, not coercion," he added.

In Washington, Attorney General Eric Holder said he was confident the justice department intended to proceed with the trial and was reviewing the ruling.

The BBC's Laura Trevelyan in New York says the judge's decision - if it stands - is a major setback for the US government's case.

Without Mr Abebe's testimony, prosecutors will struggle to put their evidence to the jury, our correspondent adds.

Mr Ghailani was detained in Pakistan in 2004, taken to a secret CIA facility and then to Guantanamo Bay in 2006.

He was subject to what the government refers to as "enhanced interrogation" by the CIA. His lawyers say he was tortured.

The government had already conceded that evidence obtained from Mr Ghailani in CIA prisons or at Guantanamo was inadmissible.

Mr Ghailani, who is believed to be in his mid-30s, was dressed in a grey jumper, dark trousers and a tie as he appeared in court on Wednesday.

He is accused of having purchased the vehicle and explosives used in the attack in Tanzania, and of having served as an aide to al-Qaeda leader Osama Bin Laden.

He denies the charges.

Whereas other detainees have been tried by military commissions, Mr Ghailani is the first Guantanamo prisoner to be tried in the civilian courts.

He faces life in prison if convicted.

The case is seen as a test of the administration's pledge to close the US military prison in Cuba by next January.