Former energy secretary Chris Huhne was facing a prison sentence today after pleading guilty to perverting the course of justice over claims that his ex-wife took speeding points for him a decade ago.

Huhne previously denied the charge and was due to stand trial alongside former wife Vicky Pryce, but dramatically changed his plea before the start of the trial at London's Southwark Crown Court today.

The 58-year-old, from Dutton Lane, Eastleigh, Hampshire, denied the charge in court last week but, when asked again today, clearly said "Guilty".

Perverting the course of justice often carries a custodial sentence, with a maximum of up to life imprisonment.

Pryce previously pleaded not guilty to a charge of perverting the course of justice between March 12 2003 and May 21 2003 on the grounds of marital coercion. She is accused of falsely taking speeding points for her ex-husband.

It had been alleged that the former energy secretary, who stood down from the Cabinet after he was charged last year, persuaded the 60-year-old economist to take the points so he could avoid prosecution.

He stepped down as the Liberal Democrat MP for Eastleigh following his guilty plea today.

Making a statement outside the court, the Liberal Democrat said: "Having taken responsibility for something that happened 10 years ago, the only proper course of action for me is to resign my Eastleigh seat in Parliament, which I will do shortly."

Prime Minister David Cameron's official spokesman declined to comment on the former minister's resignation, saying only: "It is a matter for Mr Huhne."

Nick Clegg said today that he was "shocked and saddened" by Chris Huhne's dramatic guilty plea to perverting the course of justice.

But the Liberal Democrat leader said the former energy secretary had taken the "right decision" to step down from Parliament in light of the admission.

"This is obviously an extremely serious matter and it's essential that the legal process is now allowed to run its course," Mr Clegg told reporters.

"I am shocked and saddened by what has happened, but I believe that Chris Huhne has taken the right decision in resigning as an MP."

Liberal Democrat leader of Eastleigh Borough Council Keith House said of the MP's resignation: "It is very, very sad to learn of Chris's resignation. He has been a hard-working MP for Eastleigh for the last eight years and has built up a reputation for hard work, both locally and nationally.

"The Liberal Democrats have a solid base in Eastleigh. They have won every election here for eight years and we will go forward.

"I will be involved in the selection of a new candidate but I am not looking to be the candidate."

The events which led to the charges date back to March 2003 when Huhne's car was allegedly caught by a speed camera on the motorway between Stansted Airport in Essex and London.

The allegations emerged in 2011 after Huhne's 26-year marriage to Pryce ended when he admitted an affair with PR adviser Carina Trimingham, who was in the public gallery in court today.

Granting Huhne, whose father was also in court today, unconditional bail until a sentence date to be fixed, Mr Justice Sweeney told him: "I will deal with your sentence on a date to be notified.

"It is essential that you attend, obviously, on that date.

"As Mr Kelsey-Fry (Huhne's barrister) has foreshadowed, you should have no illusions whatsoever as to the sort of sentence that you are likely to receive."

Huhne's departure from the Commons is the latest humiliation in a tumultuous fall from grace that began when allegations over the speeding penalty surfaced early in 2011.

He was only narrowly beaten by Mr Clegg for the party leadership in 2007, and was still regarded by many as the Deputy Prime Minister's natural successor.

The 58-year-old strongly denied the claims when he was charged by prosecutors last February, and repeated the denials in court as recently as last week.

But when asked again this morning, he clearly stated: "Guilty."

PR adviser Carina Trimingham was in the public gallery to watch as Huhne made the admission. The emergence of their relationship in September 2010 ended his marriage to 60-year-old Pryce, and the speeding allegations leaked out soon afterwards.

Perverting the course of justice carries a maximum sentence of life - but the average is around 10 months.

Under Commons rules, MPs are only forced to step down if they receive custodial terms of more than 12 months, but realistically Huhne's departure was regarded as inevitable.

Huhne's exit raises the prospect of a major coalition clash in the by-election for his Eastleigh seat.

The Lib Dem MP had a majority of 3,800 at the 2010 general election, but it is viewed as a key target seat for the Conservatives if they are to get an overall majority in 2015.

There is also the prospect of UK Independence Party (Ukip) leader Nigel Farage making another run for Parliament. He previously stood unsuccessfully in the seat.

Party sources said Ukip would be fielding a candidate in Eastleigh and Mr Farage would consider the situation, adding that the constituency was "very close to his heart".

Pryce's case was adjourned until 10am tomorrow at Southwark, when a trial is expected to start. She was granted unconditional bail.

Huhne received a severance payment of around £17,000 when he resigned from the Cabinet last February.

However, Downing Street insisted today it was a matter for him whether he returned the money.

It is also not yet clear whether Huhne could face being stripped of his Privy Council membership - which gives him the title "Right Honourable".

In the past disgraced ministers such as Jonathan Aitken and John Profumo have voluntarily given up their membership.