The teenager was taken into military custody days later and flown back to the UK to be questioned by police.

McGee appeared before the Central Criminal Court in London. The court confirmed he pleaded guilty to a charge of possession of a document of information useful to terrorism.

He also pleaded guilty to a second charge of making explosive substances under suspicious circumstances.

McGee is due to be sentenced next month.

An Army spokesman confirmed at the time of the incident that the Royal Military Police were working closely with Greater Manchester Police regarding the case.

He added: “All those who are found to fall short of the armed force’s high standards are dealt with through the disciplinary process. Instances of unacceptable behaviour in the armed forces are investigated and appropriate action taken – up to and including dismissal.”

McGee was based in Paderborn, Germany, at the time with the battalion.

McGee was released on bail ahead of sentencing. He will be sentenced at the Old Bailey on November 28.

The nail bomb was discovered after police arrived at the house with a search warrant as part of an investigation into abusive images.

McGee, a former Salford City Academy pupil, was serving with the armed forces with 5th Batallion the Rifles in Paderborn, Germany, at the time of the discovery. He joined the armed forces shortly after leaving school in 2011.

Private McGee was taken into military custody days later and flown back to the UK handed over to Greater Manchester Police and arrested under Section 57 of the Terrorism Act.

The former soldier's Facebook profile show numerous images of McGee dressed in English Defence League clothing and Klu Klux Klan costumes, as well as images of former EDL leader Tommy Robinson. He also 'likes' the official page of BNP leader Nick Griffin.