A Somali asylum seeker jailed for several sex attacks but allowed to stay in the UK was given a British passport "in error", the Home Office has said.
A passport was issued to Mohammed in 2005
Last week Sadiq Mohammed, 31, was jailed indefinitely by Bristol Crown Court for molesting a young girl.
He had previously been recommended for deportation after attacking three women in 1999, including a teenage girl.
A Home Office spokesman said an investigation had been carried out and appropriate action taken.
"The issuing of a British passport to Mr Mohammed was the result of a one-off error by an individual passport examiner," said the spokesman.
"The passport in question has been revoked.
"This should not affect any deportation process concerning Mr Mohammed."
On Friday, Judge Tom Crowther, sitting at Bristol Crown Court, said Mohammed posed a great risk to the UK public and recommended him for deportation again.
"There's a real reason to expect that he will commit a similar offence in the future, he said.
"It's right now, as it was in 2000 with Judge Bootham, to recommend to the Home Secretary that he be deported.
"Whether he is or not is outside the realms of my jurisdiction."
The jury at his most recent trial had been told Mohammed, of Ecclestone House, Barton Hill, Bristol, had attacked three women near his home in 1999.
He was jailed for four years on one count of sexual assault and two of common assault, which the court had heard were both sexually motivated, and recommended for deportation.
Mohammed was also placed on the Sex Offenders' Register.
In what the Home Office described as a "gross error", he was issued with a British passport in 2005.
In 2006, Mohammed took a seven-year-old girl from outside a shop and sexually assaulted her in his Barton Hill flat.
He had denied one charge of child abduction and sexual assault, but a jury at Bristol Crown Court found him guilty on both counts.
Sentencing Mohammed, Judge Crowther handed him an indeterminate jail term and said he would need to serve a minimum of three years before he could be considered for parole.
Mohammed had interrupted the sentencing hearing, claiming he was a British citizen and held a legitimate British passport.
A Home Office spokesman said: "The government has made clear that public protection is the overarching priority of the Home Office.
"Whilst our policy is to seek to enforce removals to all countries, there are some countries, like Somalia, that historically it has been difficult to enforce removals to.
"Mogadishu International Airport has now reopened and commercial airlines are flying in and out of without hindrance."