A man in Texas was sentenced to six months in jail for a dispute over his child support, even though he's paid his ex-wife exactly what he owed her.

By the time he was called to Houston court, Clifford Hall had paid his child support in full, including $3,000 in backpay that was not withheld from his paychecks—a mistake caused by administrative error, according to Hall and his attorney.

"I discovered for some reason his employer was withholding a large amount some weeks, a small amount some weeks, [and] a zero amount some weeks," said Hall's attorney, Tyesha Elam. "I didn't want to go to jail basically," Hall added, noting that he quickly repaid the $3,000.

But not quick enough for Judge Lisa Millard, who ordered that Hall pay an additional $3,000 for his ex-wife's attorney's fees. Then, noting that Hall hadn't followed the court's schedule for picking up his children—a schedule Elam and Hall said they did not know about—Millard sentenced Hall to six months in jail.

"When she said I remand you to the Harris County Jail for 180 days my mouth just dropped," said Hall, who was found in contempt of court after walking out upon hearing the sentence. "I can't be there for my son in jail. I can't pay child support in jail. This is not in the best interest of the child."

Elam agreed. "I'm like he couldn't have gotten a worse result," she told Fox 26 in Houston. "He could have gone in there with a monkey and gotten a better result."

Hall will turn himself in in a few days, but in the meantime, Elam is working on an appeal.