A western Pennsylvania man who threatened to have a female U.S. postal inspector investigating him for child pornography possession gang-raped and murdered was sentenced Tuesday to 38 months in prison.

Todd Markley, 49, of Export, pleaded guilty in February to possessing child pornography and threatening a federal officer.

The sentenced handed down by U.S. District Judge David Cercone was less than the five years in prison federal prosecutors sought, but far more than argued for by defense attorney Richard Joyce. He sought some kind of home confinement, citing Markley's unusual medical history which, the defense attorney argued, both contributed to Markley's crimes and made it likely that he would not receive adequate care in prison.

Joyce argued that Markley suffered from, among other things, spina bifida, nerve problems which cause him migraines and other pain, and a pituitary gland condition that, before it was treated, caused Markley to look like an adolescent well into his 20s. The defense attorney argued that Markley's fascination with young males -- no girls were depicted in the pornography he possessed -- may have stemmed from Markley's own arrested development.

Cercone noted that federal sentencing guidelines called for between 15 to 21 months in prison for the threat, but 51 to 63 months for the child pornography. Assistant U.S. Attorney Jessica Smolar sought a sentence at the upper range of the child porn guidelines, but Cercone's sentence more or less split the difference between the two crimes. Markley must also spend 10 years on probation and register as a sex offender for 15 years after prison.

Markley was targeted in a federal string operation after his name showed up on a customer list of a Los Angeles-based distributor of child pornography that was raided in 2006. Markley's home was raided in April 2012 after he requested an emailed catalog of DVDs and ordered two videos from a dummy child porn business that federal agents used to target customers of the defunct California distributor.

Agents seized the videos mailed to Markley in the sting operation, a desktop computer and three thumb drives -- two of which agents later discovered contained more than 600 images of child pornography.

Markley and his attorneys said he sent the expletive-filled diatribe to Postal Inspector Karen Yoakum, who took part in the search, during a suicide attempt involving antianxiety medications and alcohol that was prompted by his fear of prison.

In the email, Markley denied viewing the thumb drive pictures for four or five years -- though investigators later determined he viewed some pictures just days before the raid -- and claimed to have counseled several troubled boys through an unspecified church ministry.

"You are such a stupid (expletive), that you brought down the type of person you should be promoting," the email said.

Markley claimed to have counseled a youth who returned to a life of "organized crime" and was offered $3,000 by Markley to kill and rape the postal inspector with help from unspecified associates.

"And I've instructed them to make your death as painful, drawn out and humiliating as possible. You will probably be raped by at least 10 guys before they kill you," Markley wrote.