LOS ANGELES (CBS/AP) — A San Fernando Valley man who spent more than 13 years in prison for a crime a federal judge said he didn’t commit was released Tuesday while an appeal on his case is pending.

READ MORE: Orange County Deputies Open Fire Inside Foothill Ranch Walmart, Suspect Wounded

Daniel Larsen, 45, walked out of a downtown Los Angeles federal courthouse with his wife, Christina, by his side.

“(I) feel good,” said Larsen.

“I want to thank the Innocence Project….I thank the judge for lifting the stay and thank God. That’s it,” said Christina.

Larsen was convicted in 1999 for carrying a dagger after two Los Angeles Police Department officers said they saw him throw the knife under a car outside of a bar.

Since Larsen already had two previous burglary convictions, he was sentenced to 27 years to life in prison under California’s three strikes law.

A decade later, officials with the California Innocence Project found two new witnesses, including a former chief of police, who testified in court that it was another man who was in possession of the knife.

In 2010, a federal magistrate ruled that “had the jury been able to hear the new evidence, no reasonable juror would have found Larsen guilty beyond a reasonable doubt.”

READ MORE: Long Beach Unified's Classified Workers Threaten Strike After Contract Talks Break Down

The judge reversed the conviction and found Larsen innocent. Larsen’s attorney was also found to be incompetent.

Despite the ruling, Larsen remained behind bars.

California Attorney General Kamala Harris appealed the judge’s decision because Larsen’s current lawyers missed a deadline for filing papers.

The Innocence Project filed an appeal under habeas corpus that reached the U.S. 9th Circuit Court of Appeals, which found Larsen to be “actually innocent,” a legal term that allows him to be released while his case continues to go through the court system.

The appeals court ordered the lower court to set conditions for Larsen’s release.

Larsen must pay $52,000, cannot leave Los Angeles County, must look for work, has to undergo drug testing and anger management counseling, and cannot have any contact with gang members, said Larsen’s lead attorney Jan Stiglitz, who is co-director of the Innocence Project.

Larsen’s case will return to the 9th Circuit Court of Appeals for a final decision on his freedom once the Supreme Court rules on the tardy filings.

Stiglitz said that could come in June, but it’s also possible the high court will decide it should never have taken the case to begin with.

MORE NEWS: Amazon To Open First Ever Brick-And-Mortar Clothing Store In Glendale

(TM and © Copyright 2013 CBS Local Media, a division of CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2013 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)