BANGOR, Maine — The Maine Supreme Judicial Court on Tuesday ruled unanimously in favor of six counties in a lawsuit over the bulk copying of electronic documents in registries of deeds. The justices also upheld a 2011 law that set the fees counties may charge for electronic copies of documents.

The decision preserves an important revenue stream for counties, according to Peter Marchesi, the Waterville attorney who represented the counties.

The court’s ruling reversed a lower court’s decision in favor of John Simpson, owner of MacImage of Maine LLC. He filed Freedom of Access requests in 2009 with the counties to create his own statewide document database. In November 2009, the Cumberland businessman sued Androscoggin, Aroostook, Cumberland, Knox, Penobscot and York counties in Androscoggin County Superior Court, alleging that the fees the counties wanted to charge for digitized documents were unreasonable. The price quoted by Penobscot County was $1 per page for 4 million pages.

Justice Thomas Warren ruled in Simpson’s favor in early 2011 and the counties appealed the case to the Maine Supreme Judicial Court. While the appeal was pending, the Legislature passed a bill that set the fees counties may charge for copies of records at registries of deeds.

The Maine Supreme Judicial Court, which heard oral arguments in the appeal in December, focused its ruling on the new law, not the original lawsuit.

“The Legislature was required to balance the public’s interest in access to the records with the governmental costs of making those records available,” Chief Justice Leigh I. Saufley wrote for the court in the 28-page decision. “It has done so in an area of evolving technology and varied fiscal considerations. … We conclude that the Legislature had a rational basis for acting to resolve an issue of important public interest.

“The means employed to address the issue may have resulted in reduced anticipated revenues for MacImage and Simpson, but the Legislature could have balanced their private interests with the counties’ and the public’s interests to design its legislative solution, and this type of exercise of its legislative power is neither arbitrary nor capricious.”

The law the justices upheld Tuesday set standardized fees that replaced those charged by each individual county for copies of documents at registries of deeds. Before the law was passed, there was no statewide standardized fee schedule.

Simpson’s attorney, Sigmund Schutz of Portland, on Tuesday said the decision would make it difficult for entrepreneurs such as his client to launch new endeavors when lawmakers are able to enact statutes as business plans are being implemented.

“The Legislature changed the rules of game more than halfway through the legal process,” the lawyer said.

Schutz said he did not know if Simpson would go forward with his business plan or not. The attorney said that without a statewide website, people seeking online records must search each county’s website individually and pay for documents separately if they are obtained from different registry of deeds offices.

The American Civil Liberties Union of Maine also criticized the court’s decision. The organization filed a “friend of the court” brief in the appeal in support of Simpson.

“The legislature erected unreasonable barriers to public access, and we believed that those barriers were also illegal,” Zachary Heiden, an ACLU of Maine attorney, said Tuesday in an email. “We are disappointed in the court’s ruling today.

“Information about land records and real estate transactions are matters of serious public concern, as the recent global economic crisis demonstrated,” he said. “The public needs the ability to access public information as easily as possible. It is now up to the legislature to fix the situation.”

Historically, counties around the state have relied on income from selling copies of documents tiled with their registries of deeds and, to a lesser extent, probate.

Susan Bulay, register of deeds for Penobscot County, estimated in 2009 that the county could lose between $150,000 and $200,000 in income annually if MacImages’ lawsuit was successful because people would be able to buy land records from Simpson’s site for less than they could from the county.

In defending their decision to charge MacImage millions in copying costs, the counties argued before Justice Thomas Warren in October 2010 in Androscoggin County Superior Court that they are required to be financially self-supporting by law and must be able to recover their costs to scan and maintain millions of documents, according to previously published reports.

Warren disagreed, concluding that state law does not authorize counties to charge fees based on overall costs of maintaining their data because “whether or not electronic copies were ever requested by or are ever produced to MacImage, the registries have already created their electronic databases of land records” for the registries’ general and respective uses. The cost for counties to scan and store records does not change whether MacImage, or any commercial entity, seeks access to records, so the counties cannot charge to recover standard operating costs, the judge ruled.