SAFE SEX: Prosecutors claim a brothel in this East 78th Street building got protection from law-enforcement officials.

(NY Post: William C. Lopez)

(
)

A soccer mom with four kids ran an Upper East Side brothel that raked in millions of dollars catering to wealthy, powerful johns — allegedly using her cop connections for protection, according to explosive court documents.

“I see people in and out coming over here . . . sometimes many in one day,’’ said Mohammed Azad, 32, who owns a restaurant in the building where Gristina allegedly operated her brothel. “I always see young fashionable women, always under 30 . . . They don’t live here.’’

The petite, blond Gristina was caught on wiretaps claiming “to have made millions over the 15 or so years she has been in business as a madam,” Linehan said, according to newly released transcripts of the Feb. 23 hearing.

At least once, the married mom, who lives with her family in upstate Monroe, arranged a sexual encounter for a client in which “minors were involved,” Linehan said.

He cited information from at least one eyewitness account — a confidential informant who was one of Gristina’s own hookers.

Known in the industry as “Anna Scotland,’’ the Scottish native was nailed as part of a five-year investigation by the DA’s Official Corruption Unit, which probes NYPD and other uniformed officers for possible misconduct.

At one point, Gristina was caught on tape saying her law-enforcement pals were “poised to help her out, to let her know if there is trouble on the front that she needs to be concerned about, particularly back during the Eliot Spitzer investigation,” Linehan said, referring to the former governor’s hooker scandal.

An arrest warrant was issued for Gristina last month.

When cops arrived at her upstate home,, where she rescues wild pigs and raises pit bulls, they didn’t find anyone — but a wild boar chased a police officer around, the sources said.

Gristina was nabbed soon after in the company of a Morgan Stanley banker and “close friend’’ whom she was trying to get to help her expand her operation through the Internet, the court papers revealed.

She was held on a $2 million bond or $1 million cash bail.

Gristina’s Monroe neighbors were stunned to learn of her bust.

“I’m in shock,’’ one neighbor said. “She seems like a very nice person.’’