Mediation efforts this week failed to settle a major tax dispute between the state and Enbridge Energy, so cases involving tens of millions of dollars in tax revenue will head to court.

Enbridge Energy has appealed five years of property taxes, saying the Minnesota Department of ­Revenue overvalued its massive pipeline system. If Enbridge wins its appeals, some northern Minnesota counties and local governments will be on the hook for potentially budget-busting tax refunds.

While the state Revenue Department sets valuations for pipelines, utilities and railroads, tax money raised is sent to the counties that host the properties. Counties pass some of that money on to local governments and school districts.

Enbridge and Revenue Department officials had a “formal mediation session” on Monday, but a settlement was not reached, according to a memo from the department to auditors and assessors in 13 counties.

Enbridge’s system of six cross-state pipelines runs across those 13 counties, starting in Kittson County in Minnesota’s northwest corner, and traveling southeast ultimately through Carlton County before reaching a terminal in Superior, Wis.

Enbridge and the Revenue Department will jointly contact the Minnesota Tax Court “to determine the next steps,” the Revenue Department said.

The department said it expects that Enbridge’s appeals for 2012, 2013 and 2014 will be tried before the Tax Court in October. Enbridge’s appeals for 2015 and 2014 will likely go ­forward after that trial has been completed.

Any tax refunds to Enbridge would particularly hammer host counties that — besides the pipeline system — have thin commercial and residential tax bases.

For instance, Clearwater County, home to an Enbridge terminal, would owe about $7.2 million in refunds, more than its annual tax levy of $6.8 million. Red Lake County, the state’s third smallest county, would be in a similar situation.

Enbridge said in a statement Friday that the company and the Department of Revenue had agreed to the mediator’s confidentiality requirements, so Enbridge had no comment. The state also declined to comment.

Calgary, Alta.-based Enbridge is North America’s largest pipeline operator. In Minnesota, it transports crude oil from Alberta, Canada and North Dakota. Much of that crude runs to Superior, where it is then put into Enbridge pipelines going south and east through Wisconsin.

Oil shipped south from the Clearbrook terminal provides much of the crude oil refined in the Twin Cities.