The Nigerian man accused of trying to use a bomb in his underwear to blow up a U.S. airliner on Christmas Day 2009 pleaded guilty on Wednesday to all charges against him and warned the United States could face a great calamity.

Umar Farouk Abdulmutallab, 24, entered the guilty pleas a day after testimony began in his trial. Not-guilty pleas had previously been entered on behalf of Abdulmutallab, who was representing himself in the trial with help from an attorney.

Abdulmutallab, who is linked to al Qaeda, pleaded guilty to eight felonies, including conspiracy to commit terrorism, attempted murder and attempted use of a weapon of mass destruction. He faces life in prison when sentenced January 12.

Abdulmutallab told the judge he was fulfilling a religious duty and participating in an act of jihad against the United States. He said his planned attack was meant to avenge the deaths of innocent Muslims in Yemen, Afghanistan and elsewhere.

The U.S. should be warned that if they continue to kill and support those who kill innocent Muslims, then the U.S. should await a great calamity ... or God will strike them directly, he said.

If you laugh at us now, we will laugh at you later.

Al Qaeda's Yemen-based arm claimed responsibility for Abdulmutallab's plot, which also was praised by Osama bin Laden months before the al Qaeda leader was killed in a U.S. raid in Pakistan.

In order to accept his plea, U.S. District Judge Nancy Edmunds required Abdulmutallab to make a statement to the court acknowledging the factual basis of all eight charges against him.

Abdulmutallab, dressed in a tan African tunic with a Western-style sport coat, began by invoking Allah, the most merciful.

In the statement, which lasted about five minutes, Abdulmutallab said he had violated U.S. law but not Islamic law.

In late 2009, in fulfillment of a religious duty, I decided to participate in a jihad against the United States, he said.

He told the court that attacks against the United States like the one he attempted were the most virtuous of deeds ... but my actions make me guilty of crimes in the United States.

Outside the court, Anthony Chambers, the standby attorney assigned to help Abdulmutallab, said the Nigerian had made the decision to plead guilty against his advice.

I would never advise a client who was facing life to plead guilty in this manner, he said. We wanted to continue on. It's disappointing.

Abdulmutallab previously told U.S. investigators he had received the bomb, which failed to detonate fully, and training from al Qaeda militants in Yemen, U.S. officials have said.

After the attempted attack, the Obama administration moved to strengthen U.S. airline security by deploying full-body scanners to try to detect explosives that could be hidden in a passenger's clothing.

In his opening statement on Tuesday, U.S. Attorney Jonathan Tukel said Abdulmutallab had admitted to each and every person he came into contact with that he was trying to bring down Northwest Flight 253 as it approached Detroit from Amsterdam with 290 people aboard.

Tukel showed the jury a picture of the remains of the underwear he said contained the explosive device Abdulmutallab tried to detonate.

Michael Zantow, the only witness called Tuesday, said he was sitting a row behind Abdulmutallab when he allegedly tried to ignite the bomb. Zantow helped subdue Abdulmutallab and said that after his pants were stripped off, he saw that the man was wearing what looked like adult diapers.

All I know is they were bulky, and they were burning, Zantow testified.