A rapist whose victims included “Top Gun” actress Kelly McGillis got taxpayer-funded Viagra for years, despite his fiendish history, it was revealed yesterday as he was sentenced to 50 years in prison.

Serial sex predator Leroy Johnson was prescribed the erectile dysfunction pill by doctors at the Bronx-based Fordham-Tremont Community Mental Health Center from early 2003 to mid-2005, according to court records.

The health center stopped doling out the little blue pills to Johnson only after new DNA tests linked him to a 1996 knife-point double rape – bringing his total number of rape victims to five.

Center officials didn’t return calls; Johnson’s extensive sex crime history would have been available to doctors when they began seeing him in 2002.

Johnson, arrested for the 1996 rapes last year, was convicted June 13.

The health center’s Viagra-for-a-rapist treatment plan came to light yesterday as he was slapped with the max for the rapes – and as his two victims gave wrenching accounts of the emotional fallout.

“The person I was is gone. I mourn the loss of her every single day,” said one of the women attacked in their shared Greenwich Village apartment.

Noting painful nerve damage she suffered in her right hand, she added: “I felt raped every time I picked up a pen.”

Her then-roommate, who lamented “All my dreams went black,” added:

“You took my innocence . . . You robbed me of the ability to live my future. I was wearing a Wonder Woman T-shirt when Leroy Johnson came in and raped me – I will never get that girl back.

“I will go through the whole of my life never knowing who I was going to be.”

Defense lawyer Bryan Konoski asked for some leniency, noting that Johnson, 39, suffers mental illness and had a childhood scarred by sexual abuse and drug-ravaged parents.

But Justice Renee White was unmoved.

“As you gave no mercy to your victims, the court sees no reason to give mercy to you,” she said.

“You stole their sense of security; you stole their jewelry; you stole their money; you stole their bodies, and you stole their spirit.”

Johnson’s first rape was at age 13. As a 15-year-old crackhead and juvenile-jail escapee, he and an accomplice forced their way into McGillis’ Upper West Side apartment, raping both the young actress and her roommate at knifepoint.

Freed on that rape by 1989, Johnson attacked a Midtown nurse he was supposed to be protecting while snatching a purse on his first day of a security job.

QUOTES

What a victim said yesterday

‘All my dreams went black. I will go through the whole of my life never knowing who I was going to be.’

What the judge said

‘You stole their sense of security… their jewelry … their money … their bodies, and … their spirit.’