Josh Duggar
CNN  — 

A federal appeals court upheld the child pornography conviction of former reality TV star Josh Duggar, rejecting his arguments for a new trial, court documents show.

Duggar was sentenced last year to 12 years in federal prison after being found guilty of receipt of child pornography and possession of child pornography.

He is the oldest son of Michelle and Jim Bob Duggar, whose family and devout Christian lifestyle were the subject of the TLC show “19 Kids and Counting.”

Duggar appealed his case to the 8th Circuit Court of Appeals in an effort to “suppress incriminating statements” he made to federal authorities and to overturn a lower court’s decision to deny another person’s previous sex offense convictions from being mentioned during the trial, according to court documents.

Duggar’s attorneys argued that federal agents who searched a car dealership where he worked “violated his right to counsel,” the court documents show.

Duggar reportedly asked federal agents serving a warrant, “Has somebody been downloading child pornography,” before they were able to give him further explanation of the warrant, according to court documents.

The documents say Duggar also told federal agents he had installed file sharing software on all his electronic devices, including his office computer.

“The district court did not err in admitting into evidence defendant’s statements as a reasonable person in defendant’s position would not have believed he was in custody at the time the statements were made to police,” the three-judge appeals court panel ruled.

Duggar was not arrested at the termination of the questioning, the panel said in its ruling. “To the contrary, he ended the interview on his own and then left the dealership – hardly an option available for someone in custody,” the ruling says.

Duggar’s attorneys also argued in the appeal that the district court judge “deprived him of his right to present a complete defense,” by not allowing his attorney to mention a former employee’s sex-offense conviction.

“Duggar, for his part, tried to point the finger elsewhere. Looking to convince the jury that it faced ‘a classic, old-fashioned ‘whodunit,’ he suggested that a former employee, who happened to be a convicted sex offender, was to blame. Duggar ultimately decided not to call him to the stand, however, because the district court ruled that any mention of the employee’s prior conviction was off-limits,” the panel said in its decision.

The appellate judges noted that the district court tried to strike a balance by allowing the former employee to testify but blocking mention of the prior sex crime. “The court had no obligation under the Fifth and Sixth Amendments to do anything more,” the ruling said. “The right to present a complete defense … does not trump a district court’s discretion to keep out confusing or misleading evidence, even if it would be helpful to the defense.”

CNN has reached out to Duggar’s attorney and the Duggar family for comment.

CNN’s Melissa Alonso contributed to this report.