BOSTON — The state appeals court has upheld an earlier ruling that declared a stretch of Marshfield beach was owned by the town, despite claims of neighboring residents who say it belongs to them.

In a decision issued Tuesday, the court found that Judge Harry M. Grossman was right in ruling that residents of the Rexhame Terrace neighborhood had no ownership interest in six lots west of Circuit Avenue that make up Old Rexhame Beach, a small stretch of coastline south of the larger Rexhame Beach.

Grossman also ruled in the 2014 land court decision that the public has the right to access the beach from Winslow Avenue.

The decision could perhaps be the last blow to a group of Rexhame Terrace residents who filed a lawsuit in 1998 seeking to block access to the beach by nearby residents. They argued that the stretch of sand had been open to their families for decades.

The plaintiffs in the case included 16 people whose families collectively owned 11 of the 33 homes in Rexhame Terrace, along with several undeveloped parcels.

Those residents did win a partial victory in the 2014 decision, with Grossman ruling that four streets within Rexhame Terrace — Ames Avenue, Raleigh Road, Kent Avenue and Waterman Avenue — are private and could be closed to the public.

The dispute over the ownership of the beach dates back to the mid-1600s, when a property "east with the beach" was transferred to settler Joseph Beadle by the town.

Legal arguments have been based on language in a series of deeds, which were recorded as property and passed by Beadle's descendants and other landowners over the centuries.

One landowner, Briggs Thomas, sought to establish his claim to the beach in the 1830s after a law was passed prohibiting him from grazing his livestock there, but his claim was rejected.