Deputy Sorenson was terminated by Sheriff Jim Kaelin back in 2016 when the deputy left a loaded gun inside a department store's dressing room.

Deputy Sorenson admitted to leaving his gun, calling it an 'accident,' he then appealed the termination to the Civil Service Board who denied that appeal.

When that appeal failed, Sorenson went to a district court judge to try another appeal. His lawsuit claiming that the board intentionally deleted recording of the first appeal hearing.

But the county attorney said it was simply a malfunction of the county's recorder, asking instead for Sorenson to go before the Civil Service Board for a retrial.

However that request was denied last week.

Sorenson's attorney, Rene Rodriguez said "The statute is real clear, it says look when you appeal it, you have to have a certified copy of the entire proceeding, and they didn't have it, they wanted to have another shot at it and the judge said no."

The judge reinstated Deputy Sorenson to work for the sheriff's department after two years of not being on the force.

The county has also been ordered to pay Sorenson back pay from when he was fired back in 2016, including benefits.

They must also cover over $25,000 in attorney's fees.

The county does have 30 days to appeal this decision.

3News reached out to Nueces County Sheriff Jim Kaelin to see what he had to say, but have not yet heard back.