(Reuters) - A federal appeals court on Wednesday ruled that a New York Jewish congregation is the rightful owner of the nation’s oldest synagogue, in Rhode Island, along with a set of bells worth millions.

The decision by the First Circuit Court of Appeals in Boston marks the latest turn in a long-running legal battle that began when members of the Touro Synagogue in Newport tried to sell a set of ritual bells, called rimonim, worth some $7.4 million.

New York’s Congregation Shearith Israel attempted to block the deal, citing an 18th century agreement that named it a trustee.

A lower court last year placed ownership of the synagogue with the Rhode Island congregation that worships there, Newport’s Congregation Jeshuat Israel. The appeals court reversed that decision citing previous agreements.

“We hold that the only reasonable conclusions to be drawn from them are that CSI (Congregation Shearith Israel) owns both the rimonim and the real property,” the ruling said.

Louis Solomon, an attorney for Shearith Israel, said in a statement he was gratified by the ruling.

“We will continue in our historic role and look forward to putting this unfortunate litigation behind us,” he said.

Gary Naftalis, a lawyer for the Rhode Island congregation, said he was disappointed by the ruling and was exploring legal options.

The historic building was consecrated in 1763, when the town had one of the largest Jewish populations in the American colonies, including many who had fled the Spanish Inquisition. It was vacated in 1776 when most of the city’s Jewish population fled at the start of the Revolutionary War.

Members of the synagogue at that time shipped a pair of valuable silver bells used in rituals to the New York synagogue, and asked its leaders to act as trustees for the vacant temple. Worshippers returned by the 1870s and the New York group’s influence waned.

Shearith sued Newport’s Congregation Jeshuat Israel when it learned the Rhode Island group had reached a deal to sell the bells to Boston’s Museum of Fine Arts. The Touro congregation had planned to use the funds to create a reserve to pay for maintenance of the building, after its finances were hard hit by the 2008 credit crisis.

The New York congregation also claimed ownership of the bells and charged that the Newport group was violating Jewish tradition by selling ritual objects.