Egyptian-born Ali Mohamed, 48, admitted conspiring with Osama bin Laden
and others to murder Americans.
Mohamed - who taught US special forces soldiers about Muslim culture - told a New York court that after he had left the army in 1989, he had helped train members of bin Laden's terrorist organisation, al Qaeda in the 1980s.
The bombings of the US embassies in Nairobi and Dar es Salaam in August 1998, were part of an Islamic Jihad, or Holy War, against western targets by bin Laden, he said.
"The objective of all of this was to attack any Western target in the Middle East," Mohamed told the court.
Plea bargaining
Mohamed also revealed that he had helped secretly move bin Laden from Pakistan to Sudan.
He was among 17 people charged in connection with the simultaneous embassy bombings.
Mohamed, who entered the courtroom in leg shackles, stood in his
prison blue uniform as he pleaded guilty to charges of conspiring with bin Laden and others to murder Americans
anywhere they could be found.
He also admitted attacking the US military in Somalia and Saudi Arabia, killing Americans at unspecified embassies and to concealing the conspiracy.
His guilty pleas followed a bargaining agreement with prosecutors.
US District Judge Leonard B Sand first said the agreement guaranteed a minimum of 25 years in prison, but after an objection by defence lawyers, the judge did not specify the length of the potential prison term.
Mohamed was among 17 people charged in connection with the embassy bombings.
Of those charged so far, six defendants are held in New York, three others are held abroad and eight are fugitives, including bin Laden, who is on the FBI's 10 Most Wanted List.
The US government has offered a $5 million reward for the capture of each fugitive.