Movie director Roman Polanski, who has spent the past 40 years on the run following allegations he raped a 13-year-old girl in California has launched a legal bid to avoid further jail time if he returns to the US.

Polanski, 83, claimed he had an agreement with a judge in 1977 which stated he only had to serve 48 days in jail for the rape.

However, the director, who has Polish and French nationality, said the judge reneged on the deal and insisted he should spend 50 years behind bars.

Roman Polanski, pictured, claims a judge reneged on a deal to serve only 48 days in jail for the rape of a 13-year-old girl and instead insisted he should serve 50 years in prison

Polanski has instructed his US legal team to petition a judge to unseal the 1977 plea agreement which he claims shows that he has served enough time in prison for the young girl's rape

According to TMZ, Polanski's lawyer, Harland Braun has petitioned LA County Superior Court to unseal details of the 40-year-old plea arrangement, which Polanski claims will show he has served enough time in prison.

Following his arrest in 1977, Polanski spent 42 days in Chino State Prison before he was released.

He claims he had an arrangement with Judge Laurence Rittenband to serve 48 days in jail.

However, Rittenband told prosecutors the director should instead be jailed for 50 years.

Polanski claims the time in state jail along with almost a year he spent on remand in Switzerland while fighting extradition more than covers the original 48-day term stipulated in the deal.

Polanski, who was married to US actress Sharon Tate, left, who was murdered by Charles Manson's gang, said he wants to be able to visit her grave in California without risk of arrest

It is understood Polanski wants to be able to visit his wife Sharon Tate's grave. Ms Tate was murdered by Charles Manson's gang.

Last month, Polanski had to turn down an invitation to head the jury at the French Cesar film awards - the country's equivalent of the Oscars - following an outcry by women's groups.

In a statement, Polanski's spokesman claimed: 'This controversy has been generated by totally unfounded information, forty years after the issue in question. It has deeply saddened Roman Polanski and his family.'

The Polish-born Polanski, now aged 83, pleaded guilty in 1977 to having sex with a 13-year-old girl during a photo shoot in Los Angeles. He served 42 days in jail after a plea bargain but later fled the United States fearing a lengthy jail time if the deal was overruled.

His case remains an international cause celebre, where some argue it is time to drop US demands for his extradition but others say he must be punished.

The Los Angeles County District Attorney's Office has long insisted Polanski remains a fugitive and subject to immediate arrest in the United States because he fled the country before sentencing.

It says his case cannot be resolved until Polanski, who has both French and Polish citizenship and lives mostly in Paris, returns to California to face justice.

France does not extradite its nationals. A Polish court last year ruled against his extradition to the United States and an earlier attempt to have him extradited from Switzerland when he went there also failed.