Ghailani was brought into the Manhattan federal courtroom wearing blue prison clothing.
Asked by the judge if he wanted her to "read this big fat indictment," Ghailani said it was not necessary and entered his plea: "Not guilty."
A total of 213 people were killed in Nairobi, Kenya, and 11 people died and at least 85 were wounded in the Tanzania bombing in the city of Dar-es-Salaam in attacks widely blamed on Osama bin Laden's al-Qaeda network.
|About 240 detainees remain held at
Guantanamo Bay [GALLO/GETTY]
Ghailani is accused of helping to buy a lorry and oxygen and acetylene tanks that were used in the Tanzania bombing, and of allegedly loading boxes of TNT, detonators and other equipment into the vehicle in the weeks running up to the bombing.
Ghailani had reportedly confessed at a 2007 hearing at Guantanamo Bay and apologised for supplying equipment used in the bombing, but said he did not know the supplies would be used to attack the embassy, according to military transcripts.
Human rights activists have welcomed the move to try Ghailani in a US court instead of using the widely condemned military tribunals at Guantanamo Bay.
But Republicans have criticised the move to transfer Guantanamo suspects to the US.
"This is the first step in the Democrats' plan to import terrorists into America," House of Representatives Republican leader John Boehner said in a statement.
Al Jazeera's Rob Reynolds says the issue of harsh treastment of detainees will no doubt be brought up as Ghailani was held for a period of time in some of the CIA's so-called "black site" prisons before being transferred to Guantanamo.
The question raised by his trial is whether the US court system can try someone held under such circumstances who may have been subjected to harsh interrogation techniques many describe as torture, he says.
The decision to bring Ghailani to trial in New York follows a review by the Guantanamo Review Task Force of 240 foreign "terror" suspects still held at Guantanamo, ordered by Barack Obama, the US president.
Obama has also ordered the Guantanamo Bay prison, set up by the administration of his predecessor George Bush following the September 11 attacks in New York in 2001, to be closed by the end of January next year.
The US president hopes other countries will take in some of the 50 detainees so far cleared for release. However, many have refused.