TAMPA — Nathan Madsen was a University of Tampa music professor when he got caught in a sting last year trying to arrange sex with a 14-year-old girl.

The girl didn't exist. He had been fooled online by a Homeland Security agent.

But investigators soon discovered a real victim, a 16-year-old he enticed to send nude photos of herself in sex acts. And computers in his home held a collection of child pornography.

On Thursday, U.S. District Judge Charlene Edwards Honeywell ordered Madsen to serve 17 years in federal prison.

In a letter to Honeywell, the victim called Madsen "an insatiable masochist" and "an empathy-lacking pedophile."

"Instead of empowering myself," she wrote, "I began associating myself with words like 'worthless,' 'sex toy,' 'slave' and 'property.' "

Madsen, now 37, never met her in person. They chatted online and on the phone.

He reached out to her after reading a blog she maintained. He knew she had low self-esteem. He knew she had an eating disorder and mental health problems.

He told her she was special. He told her he was the only one who understood her.

He made her call him "daddy," according to court records. He shared with her his own blog, according to court testimony, which featured images of women being sexually tortured. He persuaded her to share explicit photos of herself. In one video, she choked herself with a belt.

The girl was not in court Thursday. But Assistant U.S. Attorney Lisa Thelwell read the letter from her, in which she spoke of the lasting damage Madsen inflicted.

She never realized the way he had manipulated her, she wrote. She spoke of how she withdrew from family and friends and of the shame for the things he led her to do.

She knows the images she shared later circulated online as child pornography. Some people have tracked her down, she said, harassing her and her family.

"Your hands may never have physically touched my skin," she told Madsen, "but I still feel just as corrupted as if they had."

Robert Parham, a mental health counselor who specializes in treatment of sexual abusers, testified that Madsen enrolled in a treatment program shortly after his March 2016 arrest. In the nine months he spent in the program, he was "highly motivated" to identify and analyze the reasons for his sexual problems, Parham said.

Madsen acknowledged a dysfunctional upbringing, Parham said, and a childhood that was rife with abuse — physical, emotional and sexual.

Raised in Utah, Madsen came from a Mormon family, led by a mother described as "narcissistic," Parham said. Madsen's sister, Amanda Otis, also addressed the judge and described the home environment as abusive.

"I believe my mother was incapable of genuine love for her children," Otis said. "Our sole purpose was to take care of her and meet her needs."

The kids never spoke of home problems, she said. On Sundays, they were all smiles at church.

Madsen excelled academically, carving an escape through his studies. He served a Mormon mission and went on to get married and have a son. He eventually obtained a master of fine arts degree from Bard College. He loved to lead groups of musicians. He was going for a doctorate when he arrived at the University of Tampa in 2014 as a visiting professor of music.

By his own account, though, Madsen lived a double life.

In court, he stood in an orange jail suit, trembling, his hands braced on a table as he sobbed.

"I am very glad I was arrested," he said. "I was a very sick man and in that illness and darkness, I was a true danger to others."

He apologized to his former colleagues and students. He apologized to his family. He apologized to girl he had victimized, though she could not hear it.

"When it came to you, I taught all the wrong lessons," he said.

"What I did was wrong, and I must be punished for it."

In addition to prison, the judge ordered Madsen to serve a lifetime of supervised release and to register as a sex offender.

Contact Dan Sullivan at dsullivan@tampabay.com or (813) 226-3386.