HOUSTON (AP) — Convicted ex-Enron Corp. CEO Jeffrey Skilling's more than 24-year prison sentence for his role in the once mighty energy giant's collapse could be reduced by as many as 10 years if a federal judge approves an agreement reached Wednesday between prosecutors and defense attorneys.

Under the agreement, which Justice Department officials say includes a previous court-ordered reduction of as much as nine years, Skilling's original sentence will be reduced to somewhere between 14 and 17.5 years.

The agreement still has to be approved by U.S. District Judge Sim Lake, who is set to hold a June 21 hearing in Houston to make the final decision on the length of Skilling's sentence.

Justice Department spokesman Peter Carr said the agreement will allow victims of Enron's collapse to finally receive more than $40 million in restitution. The ongoing status of the case has so far prevented the government from distributing Skilling's seized assets to victims, according to the agreement.

Skilling was convicted in 2006 on 19 counts of conspiracy, securities fraud, insider trading and lying to auditors for his role in the downfall of Houston-based Enron. The company collapsed into bankruptcy in 2001 under the weight of years of illicit business deals and accounting tricks.

Skilling has been in prison since December 2006 and is serving his sentence in a low security facility outside of Denver.

The 5th U.S. Circuit Court of Appeals upheld his convictions in 2009 but vacated his more than 24-year prison term and ordered that he be resentenced, saying a sentencing guideline was improperly applied, resulting in a longer prison term.

The appeals court called for Skilling's sentence to be reduced to somewhere between 15.6 years to 19.5 years. Prosecutors agreed to a further reduction as part of their efforts to distribute the $40 million in restitution and resolve a case that's been investigated and prosecuted for more than 10 years.

"This agreement ensures that Mr. Skilling will be appropriately punished for his crimes and that victims will finally receive the restitution they deserve," Carr said.

Petrocelli said while the recommended sentence still would be more than double that of any other Enron defendant, all of whom have since been released from prison, "Jeff will at least have the chance to get back a meaningful part of his life."

Philip Hilder, a Houston attorney who represented several ex-Enron executives who cooperated with prosecutors, called the agreement a "great result" for Skilling.

"It's not ideally what either side wanted. It was a reasonable compromise to put this matter behind everybody," he said.

Petrocelli declined to comment about when Skilling might be released from prison if the agreement is approved.

The U.S. Supreme Court said in 2010 that one of Skilling's convictions was flawed when it sharply curtailed the use of the "honest services" fraud law — a short addendum to the federal mail and wire fraud statute that makes it illegal to scheme to deprive investors of "the intangible right to honest services."

The Supreme Court ruled that prosecutors can use the law only in cases where evidence shows the defendant accepted bribes or kickbacks and that because Skilling's misconduct entailed no such things, he did not conspire to commit honest-services fraud.

The Supreme Court told a lower court to decide whether he deserved a new trial. The lower court said no.

Skilling, 59, was the highest-ranking executive to be punished for Enron's downfall. Enron founder Kenneth Lay's similar convictions were vacated after he died of heart disease less than two months after trial.

Enron's collapse put more than 5,000 people out of work, wiped out more than $2 billion in employee pensions and rendered worthless $60 billion in Enron stock. Its aftershocks were felt across the city and the energy industry.