Residents of a swanky Upper East Side high-rise have 24-hour gated entry, a heated indoor pool, breathtaking views of the river — and bullets whizzing through their windows.

A mystery gunman is shooting up apartments at One East River Place from clear across the water on Roosevelt Island, law enforcement sources told The Post.

Now its residents are terrified.

“I’m petrified for my life,” exclaimed Ilene Epstein, 55, who lives in a river-facing apartment on the 22nd floor of the 50-story rental building between East 72nd and 73rd streets.

“I moved into this apartment because of the river. I have beautiful views,” said Epstein, a real estate agent. “[But] I’ll move out of my building before I walk around with a bulletproof vest.”

The first bullet crashed through the living-room window of a 14th-floor apartment in the building, whose address is 525 E. 72nd St., sometime overnight between Thursday and Friday, police sources said.

The tenant awoke Friday morning to find the living-room floor strewn with glass. Cops found a .38-caliber bullet, most likely fired from a Smith & Wesson handgun, sources said.

Less than 24 hours later, another bullet pierced the window of a unit on the 32nd floor of the building, where two-bedroom apartments can rent for more than $7,000 a month.

This time, the apartment’s tenant was jolted awake at around 1:15 a.m. Saturday by the shattering of the living-room window. Police sources said no ballistic evidence was immediately recovered in that incident.

Neither tenant was injured, but they easily could have been.

“They were lucky they weren’t up late watching television,” a law enforcement source said.

Cops were puzzled by the source of the gunfire until they realized the timing of the second shooting matched up with two 911 calls reporting shots heard coming from another apartment building — about 1,400 feet across the East River on Roosevelt Island, sources said.

Investigators “think it’s some a–hole standing on a balcony shooting across the river,” a high-ranking NYPD insider said.

Sources said the 911 calls reporting the gunshots came from two overnight workers at 30 River Road, a building in the Manhattan Park apartment complex on Roosevelt Island.

The now-boarded-up windows of the two shot-up Upper East Side apartments were clearly visible from the Roosevelt Island building on Monday.

Cops on the Roosevelt Island end had checked out the reports but marked them unfounded, with no victims or ballistic evidence in sight, sources said.

But detectives put the pieces together after realizing that the two apartment buildings sit directly across the water from each other.

Still, they were scraping for leads or a suspect, leaving the Upper East Side tenants on edge.

“What world do I live in? Who shoots randomly?” said Arik Cohen, a 45th-floor resident at One East River Place.

He said he feared another strike from the “psycho” shooter even though his apartment faces north.

“My wife is in Long Island with our baby. Maybe I should call her and tell her to stay there for a few days,” said Cohen, a 37-year-old computer programmer.

“I’m already planning on leaving New York,” he added. “This is just one more reason.”

Another tenant, who declined to give his name, deadpanned, “I’m paying close to $10,000 per month in rent so I can use the fitness center and be shot in the head in my apartment.”

Calls to a number listed for the 14th-floor apartment went unanswered, while the 32nd-floor tenant, whose name is being withheld by The Post, declined to speak about her experience.

Multiple messages left for the management at One East River Place were not returned.

A spokesman for Manhattan Park, where two-bedroom units rent for around $3,000 a month, said the complex’s management was cooperating with the NYPD. But he declined further comment, noting that the investigation was ongoing.

Until the case is closed, some residents of One East River Place say they’ll live in constant fear that they might need to duck and cover at a moment’s notice.

“I feel threatened being in my building,” said Epstein, the 22nd-floor resident. “[It] seems like it can become an everyday thing. It could happen tonight.”

Additional reporting by Larry Celona, Cedar Attanasio and Reuven Fenton