ALBANY – The state will build a “pervert prison” – a special maximum-security facility for the most dangerous sex offenders, it was announced yesterday.

Gov. Pataki yesterday said the facility is needed to confine 500 convicted sex predators considered too likely to strike again to let back on the streets after their prison terms are over.

A $130 million allocation to cover construction will be part of the governor’s budget proposal he is due to unveil Tuesday.

Pataki aides say there are several similar facilities across the country, including in Florida, Washington and California.

“We think this will be the most state of the art, secure mental-health facility in the country when it opens,” one aide said.

The facility would have a secure perimeter with double razor barbed-wire fencing.

The offenders could go outside, but would not be allowed to leave the grounds except for court hearings and medical needs, in which they would travel with security, the aide said.

While there won’t be any bars and offenders will not be locked in their rooms, there will be electronic surveillance within the facility and some restrictions on where they can go, the aide said.

Pataki wants to tear down Camp Pharsalia, a minimum-security prison in upstate Chenango County, and replace it with a new state-of-the-art facility run by the Office of Mental Heath that will house and treat the convicted offenders.

“Today there are 5,000 sexual predators awaiting release from New York’s prisons,” Pataki said. “We must do everything in our power to keep those who still represent a danger off our streets . . . and away from our children.”

Frustrated that the Democrat-controlled Assembly repeatedly blocked civil-confinement legislation, Pataki late last year ordered his administration to “push the envelope” in keeping sex offenders deemed dangerous locked up by using existing law pertaining to the involuntary commitment the mentally ill.

Creating a new facility, which would open in 2009, would allow the mental-health system to keep dangerous sex offenders whose prison terms expire away from nonviolent mentally ill patients, Pataki said.

Donna Lieberman, executive director of the New York Civil Liberties Union, said the governor is “putting the cart before the horse” since the state does not yet have a civil-confinement law on the books.

“It’s interesting he’s prepared to spend money to build yet another prison, but not engage in the kind of evaluation, monitoring, supervision and treatment of high-risk offenders that all the experts agree can significantly reduce the risk or incidents of reoffense,” Lieberman said.

Meanwhile, lawyers for the sex offenders now in mental facilities were grilled yesterday by the panel of Manhattan appellate-division judges who are deciding on the constitutionality of the civil commitments.

The inmates’ lawyers argue that Pataki is doing an end run around the corrections commitment procedures by having the inmates’ dangerousness evaluated by state doctors – essentially the governor’s own shills.