There is a battle underway beneath Boston Harbor. On one side is Harbor Electric Energy Co., a subsidiary of New England utility NStar (now known as Eversource Energy), and on the other side is the Massachusetts Water Resources Authority. They are battling over who should pay as much as $20 million to repair a construction job done 25 years ago.

At issue is whether an electric cable was laid to the proper depth below the harbor, an issue that has gained urgency with the approach of a $310-million project to dredge Boston’s ship channel to accommodate deep-draught ships.

“Everyone agrees that the cable was not laid deep enough, and everyone agrees that it needs to be protected” from the dredging operations, says Frederick Laskey, executive director of MWRA.

What they do not agree on is who should pay to right the situation. A four-mile electric cable was laid in 1990 from NStar’s (Boston Edison at the time) K Street transformer in South Boston to Deer Island in Boston Harbor to supply power for MWRA to build a wastewater treatment plant on Deer Island. The $3.8-billion plant, the second largest in the country, was built under a federal order to clean up Boston Harbor in order to avoid fines and penalties under the Clean Water Act.

MWRA and Harbor Electric entered into an agreement under which the utility undertook the permitting and construction of the underwater cable. The utility owns the cable, and MWRA paid for its installation through amortized debt payments. The project had a $41-million price cap and ended up costing $38 million, with a “fully loaded” cost over the life of the project of $104 million, according to MWRA.

Harbor Electric selected Les Cables de Lyon to supply the cable and Harmstorf Corp. to excavate the channel-bed trench. Army Corps of Engineers’ specifications called for the cable to be laid 25 ft beneath the surface of the harbor channel bed.

According to court documents filed by MWRA, recent investigations show the actual cable depth to be 12 ft below the channel bed at its most shallow point.

The contractor was using high-pressure water to plow a channel through the seabed when it unexpectedly encountered bedrock. Rather than drilling through the bedrock, the contractor laid the cable atop the bedrock but below the surface of the channel.

According to the court documents, the contractors billed NStar $4.4 million for additional expenses as a result of encountering bedrock, and NStar rejected the claim.

MWRA claims NStar informed the Corps of Engineers of the bedrock conditions, but the Corps did not consent to any deviation from the permitted depths. MWRA says it began using the cable in 1991 and did not know it was not in compliance with the required permitted depths.

In May 2003, the Corps informed NStar that the portions of the cable that are above 60 ft below mean low water (MLW) level in the reserve and main ship channels and above 65 ft below MLW in the main ship channel must be buried so that no portion is above those levels.

The depth of the cable came to light as a result of another large project now underway in Boston Harbor. The Massachusetts Port Authority, under supervision from the Corps of Engineers, has embarked on the Navigation Improvement Project and Berth Dredging Project, or Massport for short.

The project, slated for completion by early 2019, calls for the deepening of the North Entrance Channel to 51 ft from 45 ft, the main channel to 47 ft from 40 ft and all Conley Terminal berths to 50 ft.

Boston’s cruise-ship business is booming, and the city sees the dredging project as a way of ensuring that ever-larger cruise ships, as well as larger container ships, will be able to navigate and berth in the harbor.

NStar has proposed laying concrete mats over the shallow portions of the cable, a project that would cost between $10 million and $20 million, according to the court documents.

NStar claims the costs of protecting the cables is the responsibility of MWRA and is seeking recovery of those costs. MWRA maintains it is not liable for those costs, and that is the issue at the heart of its civil lawsuit, filed on Nov. 2 in Suffolk County’s Superior Court.

In its filing, MWRA says it does not “own the cable, did not install it and lacks any authority to take any action with respect to its current location.”

Harbor Electric on Oct. 30 filed a rate case with the Massachusetts Dept. of Public Utilities seeking approval of tariffs, including capital expenditures, for continuing to provide electric service to MWRA via the cable.

An Eversource spokesman said the company is “reviewing the action taken by MWRA and preparing a response.”

The parties have been disputing the issue for several years, and the failure to come to terms has resulted in the lapsing of the original 1990 rate agreement, which expired on Nov. 12.

The Nov. 2 Superior Court filing is the second for MWRA. Unable to reach terms after the first filing, MWRA is now seeking a jury trial.