LOS ANGELES: A California man who used the Internet and Facebook to connect with Al Qaeda pleaded guilty Friday to a federal terrorism charge after admitting he attempted to assist the organisation by providing weapons training, the US attorney's office said.

Sinh Vinh Ngo Nguyen, 24, unexpectedly entered the plea before US District Court Judge John F. Walter, who scheduled sentencing for March 21, prosecutors said in a statement. Reporters were not notified of his court appearance and were not present.

Nguyen faces a maximum of 15 years in federal prison.

Nguyen's lawyer, Yasmin Cader, refused to comment on his decision, quickly hanging up the phone on a reporter, and US Attorney's spokesman Thom Mrozek said prosecutors also would have no comment. The judge who accepted the plea previously had expressed scepticism about whether Nguyen had any special skills to offer Al Qaeda.

Nguyen had confessed to federal agents after he was unmasked by an undercover FBI agent posing as a recruiter for the terrorist group.

He said that he planned to offer himself as a trainer of some 30 Al Qaeda forces to ambush troops in Syria, where he had already spent five months fighting with rebels, Assistant US Attorney Judith Heinz said after his arrest in October. She said he underwent 50 hours of interrogation during which he confessed to his plan.

Nguyen's admission was contained in a plea agreement filed in federal court, according to a US attorney's press release issued after the plea was entered and accepted.

''Nguyen admitted that approximately one year ago he travelled to Syria where he joined opposition forces,'' the statement said.

''Using a social network site during a four-month period he was in Syria, Nguyen told people that he was fighting against the Assad regime and that he had had a 'confirmed kill.''

Nguyen returned to the US, where he told associates that he had offered to train Al Qaeda forces in Syria but was turned down, the US attorney's office said.

At a hearing last fall, Judge Walter asked Heinz what Nguyen had to offer the terrorist group and she said, ''He was providing himself''.

The judge noted that Nguyen was never a member of the US armed forces, having been rejected because of a hearing problem.

''I don't see evidence that this defendant had any particular skill in firearms,'' he said, ''or that he had the ability to procure or deliver weapons. ... This is the part of the case that escapes me.''

It was not immediately known what changed his mind between then and the entry of the plea.

Prosecutors said that between Aug 3 and Oct 11 Nguyen met with a man he thought was an Al Qaeda recruiter but who actually was working for the FBI, telling him about what he'd done in Syria and saying he wanted to return to jihad.

On Oct 1, Nguyen purchased a ticket for travel from Mexico to Pakistan and he was arrested by FBI agents on Oct 11 as he was about to board a bus from Santa Ana, California, to Mexico. He had been told he would be meeting ''his sheik'' in Peshawar, the prosecutor had said. When he was arrested, authorities said he exclaimed, ''How did you guys find out?''