The Minnesota Supreme Court said Friday that Gov. Mark Dayton was within his authority to line-item veto funding for the House and Senate. But justices ordered the parties engage in mediated negotiations to come up with a workable solution.

"The other branches should resolve these doubts through the political process," Chief Justice Lorie Gildea wrote for the court. "Thus far, they have not done so. As a result, Minnesotans may soon be deprived of their constitutional right to three independent branches of government."

She cited prior rulings that constitutional powers can't be used "to accomplish an unconstitutional result."

Dayton in May took the unprecedented step of canceling appropriations for the House and Senate, saying he wanted to force lawmakers back to the bargaining table. He was upset over other tax, spending and policy provisions in a new state budget but worried that vetoing full bills could force a partial shutdown.

The Republican-led Legislature quickly sued, arguing that Dayton overstepped his bounds and created an imbalance in the separation of powers. A lower court sided with the Legislature, but Dayton appealed.

In Friday's order, justices stopped short of giving Dayton a full victory and cautioned that the court "must proceed cautiously" on questions of state spending decisions where the governor and Legislature share power.

They said voters deserve the right to "three independent, functioning branches of government" and ordered the parties in the case into mediation.

The court gave the sides until Tuesday to pick a mediator and ordered them to report back by the end of September. That is also when a temporary funding agreement reached earlier expires.

The House and Senate have contingency accounts but have warned those would be used up in a matter of months, leading to staff layoffs and other complications for the Legislature's ongoing operations.

The 2018 session won't convene until mid-February and only Dayton can call a special session.

In a statement, Dayton applauded the court's support for his line-item budget power and said he remained "ready and very willing" to negotiate with legislative leaders toward a solution.

Senate Majority Leader Paul Gazelka, R-Nisswa, and House Speaker Kurt Daudt, R-Zimmerman, also said they looked for forward to negotiations.

"Today's order did not decide the case or vacate the lower court's ruling, and we are ready to go to mediation to secure funding for the legislative branch of government," they said in a joint statement.