ATLANTIC CITY, N.J. (AP) — The state can seize oceanfront land for a protective dune project in Margate, a judge ruled Monday.

It was the second major ruling in favor of the state Environmental Protection Department as it tries to assemble strips of privately owned beachfront land along the coast to build dunes, and it greatly strengthened the state’s hand is it battles pockets of resistance elsewhere along the coast.

Two weeks ago, a judge in Toms River ruled in favor of the state’s seizure of land in northern Ocean County for the project, which was begun after Superstorm Sandy devastated the coast in 2012.

Margate says its wooden bulkhead is sufficient to protect it from storms. It sued the state to block the dunes, and its lawsuit was the highest profile challenge to the dune plan.

“The state of New Jersey has taken the lessons learned from Hurricane Sandy to heart, and has concluded that an adequate storm damage reduction measure in New Jersey’s coastal communities is necessary to protect life, property, and the welfare of New Jersey’s coastal communities,” Superior Court Judge Julio Mendez wrote. “Compelling evidence was presented indicating that dunes constructed to Army Corps of Engineers specifications in other communities have been shown to protect vulnerable coastal communities from significant storms and prevent the loss of human life and property.”

The judge ruled that the state’s use of eminent domain, the taking of private property for a public purpose after paying compensation for it, was not “arbitrary and capricious” and did not constitute an abuse of state powers.

Margate officials did not immediately respond to a request for comment on Monday.

In 2013, Gov. Chris Christie began pushing for a protective sand dune project along the state’s 127-mile coast, nearly a year after Sandy devastated parts of the shore. Many oceanfront residents signed easements for free or for a nominal fee, allowing the work to be done.

But others have vociferously opposed the plan and sued the state to block it. They object to the government taking private property for public purposes, claim the state lacks authority to seize the land, and complain that the state has offered them virtually nothing for it.

The state cites a Supreme Court decision determining that the storm protection benefits of the dunes are an important factor in determining fair compensation for land seized for the project.

(© Copyright 2016 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)