Shortly after arriving from El Salvador four years ago, Maria moved to the Hamptons, where she quickly found work washing dishes in a Caribbean-themed restaurant and cleaning palatial homes that overlook sprawling white sandy beaches.

Maria lives only a few miles from those beaches, but it might as well be a world away.

Her home is a low-ceilinged clapboard motel on a parched stretch of Montauk Highway in Hampton Bays, a middle-class hamlet of 13,000 sandwiched between the tonier villages of Quogue and Southampton.

Maria’s neighbors use a rope to hang-dry clothes and they store many of their worldly possessions — an old tire, an upright vacuum cleaner, rusted paint cans, dusty Christmas decorations — in shopping carts on the tiny cement patches that double as front porches outside their rooms.

Maria lives with her two young daughters and a sister in a single motel room amid stacks of canned food, a hot plate and a plastic effigy of the Virgin Mary that has pride of place on plastic storage containers at the entrance.

She knows her living arrangement is illegal but is grateful not to be homeless, although she winces when she reveals her rent just increased by $100 a month to $1,300, and says she has to work three jobs to make ends meet.

“I never go out,” said Maria, who refused to be identified by her full name. “I just go to work and come back. I’m happy to have a place to live.”

There are 498 motel rooms in Hampton Bays, and most of them are used as illegal year-round housing for undocumented workers and other poor residents, some of whom cram entire families into a single room designed for short-term summer visitors.

The situation is in violation of Southampton Town laws, which defines a motel as accommodation for tourists “on a transient basis” and puts a cap on stays at no more than one month per calendar year. Southampton Town is the municipal authority that oversees Hampton Bays and some of the more affluent adjoining villages and hamlets in the Hamptons.

Despite living conditions that resemble those in Third World countries, elected officials here have done little over the years to enforce their own zoning rules and penalize wealthy motel owners because there is such a chronic shortage of workforce housing on the East End of Long Island. Hampton Bays has become a hub for the hundreds of undocumented landscapers, restaurant workers and cleaners who service the Hamptons elite. They are close enough so that they can easily access the mansions and high-end restaurants, but far enough away that they are out of the sightlines of the wealthy.

The situation is infuriating longtime residents of Hampton Bays who say they are witnessing the growth of “the Appalachia of the Hamptons” — the ghettoization of what they say was once a peaceful, middle-class, bay-front community.

“It’s a real hot button issue,” said Ray Overton, a Republican who is running for Southampton Town Supervisor in November. “The motel owners need to be in compliance. But if you start shutting down these motels, these people — most of them undocumented workers — end up on the street. It’s a difficult situation that really needs to be taken on.”

The situation allows the motel owners to rake in millions in cash each year from occupants who would otherwise be homeless. Motel room residents told The Post they were being charged in cash between $675 for a room in what resembled a wooden shack to as much as $1,700 for a two-bedroom “suite” in a brick-lined motel complex. One resident told The Post that she had lived with her mother in a ramshackle clapboard motel room for 28 years.

Some motel room doors lack locks, and many of the rooms visited by The Post were infested with cockroaches and fleas.

Many of the illegal motel rooms have no heating and air conditioning, and improper cooking facilities and overloaded electrical systems worry the local firefighters.

“As a volunteer firefighter those places scare the hell out of me,” said Overton, who runs a local plumbing and heating business. “They are all wood-frame buildings. It could be a huge disaster waiting to happen.”

And, the septic systems, built in the 1960s, are so fragile that “dangerous” levels of bacteria have been leaching into local waters.

In Hampton Bays, longtime residents fret about the pollution and increased taxes from an overburdened school system that has had to accommodate dozens of mostly Spanish-speaking children who are living with their parents in motels.

There are 80 students who live in motel rooms spread throughout three public schools in Hampton Bays, which accommodates 2,100 students, according to one education official.

“We have the highest tax rate and the lowest per pupil spending,” said Lars Clemensen, Superintendent of Hampton Bays Union Free District. “We just don’t have the big estates that pay lots of taxes. We have a much smaller tax base to draw from.”

Hampton Bays has the highest tax rate in the Hamptons at 17 percent — up 48 percent from 11.59 percent in 2008 — exponentially higher than the more affluent community of Watermill, where the tax rate is just above 4 percent.

Residents worry that their community is overrun with Latin gangs who are selling drugs on Montauk Highway, and even running a brothel. One resident, who didn’t want to be identified, said she installed security cameras and an automated driveway fence after a heroin addict tried to break into her waterfront home.

“We used to live with our doors unlocked,” said the resident, who spent her childhood summers in Hampton Bays. “Now I am afraid to stay in my house by myself.”

A spokeswoman for Southampton Police said that opioid use and sales have increased throughout the region, and there are “constant” police patrols along the hamlet’s main commercial thoroughfare on Montauk Highway, where many day laborers congregate, waiting to be driven to work in landscaping and construction on the estates in the more affluent parts of the Hamptons.

Concerned Citizens of Hampton Bays, an activist group with 1,000 resident members, wants the Town of Southampton to get tough with motel owners and enforce the town’s own safety codes in Hampton Bays.

“We have deep roots here, and we don’t want to see it going to hell,” said Robert Liner, a Manhattan real estate lawyer who has been spending his summers in Hampton Bays for the last 40 years.

Liner, his wife Gail, and a local builder named Michael Dunn founded the group five and a half years ago, after Suffolk County’s Department of Social Services converted a derelict motel next to Liner’s waterfront property into a homeless shelter without informing local residents. The shelter was located at the 33-room Hidden Cove Motel and did not comply with local zoning laws.

The shelter was forced to shut its doors in 2013 after furious local residents complained to the County and Southampton Town. While protesting the shelter, Liner began looking into the other motels in Hampton Bays, realizing that most of them are breaking local laws by housing people year-round.

Concerned Citizens of Hampton Bays sprang into action and raised $5,000 for an environmental impact study that found that the outdated septic systems at many of the local motels were polluting the hamlet’s waters. It found the Bel-Aire Cove Motel, which has allegedly been housing year-round residents for several years, is the main cause of pollution in nearby Penny Pond Canal. Last year, results showed “traces of feces, excrement, ammonia which indicates decomposing urine, congealed fat indicating waste from cooking (which is not permitted in a motel), and possible other toxins.”

Calls to the motel’s owner were not returned.

In addition to pollution, the citizens’ group documented myriad fire safety code violations, including burned motel room walls and ceilings from the space heaters and construction lights that residents were using to heat their rooms during the winter months.

“The conditions were pretty awful,” said Dunn, a local builder who has lived in Hampton Bays for 40 years.

Dunn and Liner worried that people living under such marginal conditions would lead to increases in crime. They say some local residents are afraid to go to the local cinema after dark where suspected gang members use the parking lot to sell drugs. Last week eight people were arrested in a drug raid on a local house that police suspect was being used as a brothel.

In May, 2016, police arrested four suspected gang members in a double-stabbing outside CB’s, a popular local bar in Hampton Bays. One of the stabbing victims had been “disemboweled,” according to a police report. A month later, one of the suspects in the bar assault, Marvin Siciliano Nunez, now 20, would go on to be arrested for sexually assaulting a 19-year-old woman in a home invasion in upscale Southampton village. According to Southampton town police, Siciliano-Nunez, an undocumented immigrant from El Salvador who lived in Hampton Bays, forcibly entered the tony mansion brandishing a baseball bat. He was convicted or burglary and rape last month.

“We have to do something now to stop this,” a frustrated Liner told The Post as he hoisted a thick dossier of public-records searches, tax reports and an environmental impact study that he says shows that local government isn’t doing what it’s supposed to do in regulating motels.

“A motel is a motel, not a garden apartment,” he said.

Liner is so frustrated that he has recently taken his cause all the way to Washington, and plans to seek federal intervention if the Town of Southampton refuses to act.

“We are not targeting the families who are living in the motels,” Liner said. “We want the motel owners to comply with the law.”

In addition to length-of-stay limits, local rules prohibit cooking in motel rooms, and depending on the size of the room, occupancy is limited to two or three people.

But complying with the law would force residents out “on the street,” said Deputy Southampton Town Supervisor Frank Zappone, who added that the town “is paying a lot of attention to the motels.”

Dolores Stevenson says she is not afraid to be booted from the stuffy motel room she calls home.

The 81-year old former nurse’s aide and housekeeper who was born in Brooklyn lives with her dog Snuggles in a poorly ventilated room that she says is “riddled with bugs” at the Bel-Aire Cove Motel. A disabled fire alarm is attached to the wall above her bed, and cans of Alpo and a container of Coffee Mate sit on a side table, next to a hot plate where Stevenson sometimes makes tea. Stevenson has been there for eight years. She doesn’t cook in her room, and eats at local diners. Last week she says she went “high class” and ate lunch at Panera Bakery.

“I’m not afraid of anyone,” said Stevenson, who told The Post she was refusing to pay the $100 per month increase that the motel owner was charging. She currently pays $750 for her small room, where cockroaches scurried across the dresser and where the heat “works mildly” during the winters.

Asked if she gets along with her neighbors, most of whom speak only halting English, Stevenson shrugged her shoulders.

“I’m a city gal, I grew up among all kinds of people,” she told The Post, although she admitted she didn’t like her neighbor who threatened to have his bigger dog eat Snuggles.

“But the locals here have a problem,” said Stevenson, who used to own a house in Hampton Bays before her husband died. “They don’t want to mix. They want all these people here to work for them, but they don’t want them living next door to them.”