A retired Aurora high school teacher who was charged with producing child pornography two years ago was found dead Saturday with an apparent self-inflicted gunshot wound.

The body of 63-year-old Robert L. James was found in a field about 1:30 p.m. by the caretakers of a property in the 1600 block of Garfield Avenue in Aurora, according to a statement from Aurora police.

Police said James, who was wanted on child pornography charges, had apparently died of a self-inflicted gunshot wound.

The Kane County Coroner’s Office said an autopsy was performed, but his final cause of death had not been determined as of Tuesday and the case remained under investigation pending toxicology tests.

James was arrested on Jan. 7, 2016, and charged with two counts of producing child pornography, six counts of possession of child pornography, indecent solicitation of a child and sexual exploitation of a child, the Kane County State’s Attorney’s Office said in a statement at the time. He was released on Jan. 11, 2016, after posting a $30,000 bond.

Prosecutors charged that sometime before August 2015, James “produced multiple images of child pornography, and has been in possession of multiple photographic images depicting children younger than 13.” The charges also alleged that he “exposed himself to a child he knew and solicited a sexual act from that child, who was younger than 13 at the time.”

On Dec. 8, 2017, a judge set April 9 of this year as the start date for James’ jury trial, according to Kane County court records. However, James failed to appear in court for a hearing on Feb. 15 and a warrant was issued for his arrest with a bail amount of $100,000.

James worked as a math teacher at West Aurora High School from August 1985 until he retired in June 2014, a spokesman for West Aurora School District 129 Tony Martinez told the Chicago Sun-Times after James’ initial arrest.

Martinez said there was “no indication that students or former students” of James were victimized; and no evidence that any illegal activities took place on school grounds.