A federal prison officer became pregnant after secretly carrying on a prohibited sexual relationship with a cop-killer inmate she was supposed to be guarding, prosecutors announced today.

The feds say that Nancy Gonzalez, 29, a federal Bureau of Prisons officer was arrested this morning at her home in Huntington, LI, after she tried to hide her intimate prison affair with Ronell Wilson, an inmate convicted of gunning down two undercover NYPD detectives in a point-blank execution in Staten Island.

Gonzalez has told friends that she is now eight months pregnant with a baby because of her relationship with Wilson, sources said.

“Now I am carrying his child,” the guard allegedly told a colleague, according to court documents.

Justice Department investigators had launched a probe that spanned several months, ending in the prison guard’s arrest today.

Brooklyn federal prosecutors have now charged her with engaging in sexual relations with an inmate — which is a crime — and she is scheduled to be arraigned later this afternoon in Brooklyn federal court.

Gonzalez faces a statutory maximum of 15 years in prison if convicted, officials said.

Details that emerged during the criminal investigation suggest that the federal Metropolitan Detention Center in Brooklyn more resembles the stuff of Gothic romance novels than a hardened penal facility.

In one such instance, Gonzalez was intercepted on the phone confiding about falling in love with Wilson.

“I took a chance because I was so vulnerable and wanted to be loved,” Gonzalez said, according to court documents.

The guard recounted how she “kind of got sucked into his world” and seemed to view her role partly as spiritual redeemer.

Gonzalez told her acquaintance that “she felt like, well, why not give him a child – as far as giving him some hope,” the complaint says.

The investigation uncovered several seamy interludes behind the prison walls.

Other inmates reported to prison authorities that they observed Gonzalez standing in front of Wilson’s cell, with its door open, as Wilson stood in the doorway “with his pants down, exposing his genitals,” court documents say.

Later, after it became apparent that Gonzalez was pregnant, Wilson’s mother allegedly “requested a sonogram picture of the baby,” an informant told the feds, according to the complaint.

The feds say that Gonzalez also appears to have had a prior romantic relationship with another inmate before Wilson.

Experts say that prohibited relationships between federal Bureau of Prisons’ guards and inmates under their watch pose grave security risks, and officials were worried that Wilson might try to coax the guard into smuggling a weapon in for him or even assist in engineering an attempt to escape.

Only weeks ago, prosecutors told Brooklyn federal Judge Nicholas Garaufis that the 30-year-old Wilson still “represents a continuing danger” and presents a “serious threat to the lives and safety of others.”

Wilson already has been convicted of murdering NYPD detectives Rodney Andrews and James Nemorin during a 2003 undercover gun buy-and-bust operation on Staten Island, but his original death sentence was overturned on procedural grounds.

In 2007, Wilson was sentenced to death after a federal jury found him guilty of murdering NYPD detectives Rodney Andrews and James Nemorin during a 2003 undercover gun buy-and-bust operation on Staten Island — making him the city’s first federal defendant to receive a death sentence since 1954.

But an appeals court reversed the death sentence on procedural grounds in 2010.

Wilson is currently behind bars awaiting a special “penalty-phase” trial, where a jury will decide whether he should be executed by lethal injection or spend the remainder of his years behind bars.

His defense attorneys say a number of specialists believe that Wilson is intellectually handicapped, and they cite a US Supreme Court ruling that bars execution of the mentally incompetent.

But at a special court hearing late last year, a prominent psychiatrist testifying as a prosecution witness said that Wilson is not mentally handicapped.

Raymond Patterson — a psychiatrist who has treated Presidential assailant John Hinckley and Sept. 11 conspirator Zacarias Moussaoui — said that Wilson “reads and memorizes quotations,” displays a sense of humor and possesses an ability to understand abstract concepts that “was actually quite good.”

The psychiatrist diagnosed Wilson as having “anti-social personality disorder with narcissistic features,” but emphasized that Wilson was bright enough to make choices about how he lead his life.

Today’s revelation that Wilson allegedly engaged in romantic trysts with a guard is not the first time the convict has run afoul of prison rules.

Last year Wilson was involved in an incident where he refused to leave a prison recreation area, flashed Bloods gang signs, and made incendiary gang remarks to corrections officers.

It took a special team of officers to remove him. He was charged administratively with refusing to obey an order, but no one was injured in the incident, officials said.

mmaddux@nypost.com