Michael Morton, accused of murdering his wife, was released from prison after being locked up for nearly 25 years because DNA evidence proved him innocent. The prosecutor in the case was charged with failing to disclose evidence that undercut the cast against Morton – but he wasn't given a harsh penalty because of the statute of limitations. NBC's Pete Williams reports.

A former Texas district attorney agreed Friday to serve 10 days in jail for withholding evidence that could have stopped an innocent man from going to prison for nearly 25 years — apparently the first time a prosecutor has been sent to jail for concealing evidence helpful to the defense.

Former Williamson County District Attorney Ken Anderson agreed to a plea deal that will also require him to pay a $500 fine and complete 500 hours of community service after state District Judge Kelly Moore found him in contempt of court for telling a trial judge in 1987 that he had no exculpatory evidence to hand over to lawyers for Michael Morton, whose conviction in his wife's death was overturned in 2011.

Charges of tampering with evidence — which could have meant 10 years in prison — were dropped as part of the deal, under which Anderson will be disbarred.

Prosecutors are required by law to share any evidence they collect that could help the defense. But Anderson withheld two critical facts in his prosecution of Morton: that witnesses reported seeing a man park a green van nearby and walk into the woods near the Mortons' house and that Morton's 3-year-old son specifically said Morton wasn't at the scene.

Rebeca Rodriguez / AP Michael Morton spent nearly 25 years in prison after being convicted in his wife's beating death.

Morton was released from prison two years ago, when new DNA evidence proved his innocence. In March, a drifter named Mark Alan Norwood was convicted of beating Christine Morton to death her in bed based on the same evidence.

Michael Morton was in court for the hearing Friday in Georgetown.

"My number one motivating factor here is that what happened to me will not happen to you," he said, addressing Anderson. "And by what happened today, we've succeeded."

Gerald Goldstein, an attorney for the Innocence Project, a nonprofit legal clinic affiliated with the Yeshiva University Law School, said Anderson's sentence, however brief, was precedent-shattering.

"This is the first time in the country's history that a prosecutor has been found guilty of criminal contempt, will go to jail and be stripped of their law license," Goldstein told NBC station KXAN of Austin.

Pete Williams of NBC News contributed to this report.

Watch US News crime videos on NBCNews.com