MARGATE, N.J. — In the battle between Margate and the State of New Jersey over whether to build dunes along the edge of this Shore town, there was a clear loser: the people in Margate who are opposed to the dunes.

Now, with the costly and ultimately futile court battles behind them, the city is bracing for what they say is the worst-case scenario, timing-wise: The U.S. Army Corps of Engineers will start construction on Margate's beaches in late June and work through the end of August.

"I think we got exactly what we expected we would get," said Mayor Mike Becker.

Whether the state is deliberately sticking it to Margate, as some in this insular community have wondered, is open to debate — the Army Corps says no and regularly does dune work in shore towns at the height of summer.

But Margatians are still smarting over the arrival of the Weeks Marine crews and dredges on their shores beginning mid-June, right after they finish up similar work in Longport, which did not fight the dunes.

About four blocks at a time of the beaches will be blocked off, heavy pipes will be installed to pump in sand, and 24-hour work schedules will feature noisy and beeping construction sounds wafting over tony beach blocks. Just ask Ventnor, which went through it in 2009.

The beach itself will be lowered several feet to help with drainage.

As a consolation, Longport Mayor Nick Russo said his town will honor Margate beach tags this summer. Margate beach tags are already good in Ventnor. The Army Corps will also replenish beaches in Atlantic City and Ventnor, which already have dunes.

The $76.1 million contract is part of Gov. Christie's mandate to build protective dunes along the entire length of the 127-mile coastline.

Becker said lingering concerns over access, drainage and accumulating trash have yet to be fully addressed, as have the back bay flooding, which residents say was much more damaging during Hurricane Sandy.

"If anything has to be fixed, they'll come back and fix it," he said he was told.

The Army Corps has promised to "make efforts to accommodate" Margate's Fourth of July fireworks. And it is anticipated that the current Beach Patrol headquarters building will have to be moved in front of the dune due to elevation issues.

Becker said the town does not rely primarily on rentals, so any impact there will be limited. But he says he's still concerned about businesses during the summer, including restaurants.

"We're in for a long summer," Becker said.

After their fight with the state's Department of Environmental Protection, which cost the city and a group of residents who also sued several hundreds of thousands of dollars, Becker said it was clear who came out ahead.

"The DEP is the most powerful department in the state of New Jersey," he said.

That point will be driven home all summer long.