In what is expected to be an extremely crowded courtroom in downtown St. Paul, the epic legal wrangle over the state government shutdown that could begin July 1 gets its first hearing Thursday morning.

Ramsey County Chief Judge Kathleen Gearin will hear arguments over a petition brought by Attorney General Lori Swanson that attempts to keep some state services operating after that deadline, despite the increasingly remote possibility of a budget agreement. Gov. Mark Dayton and the Republican-led Legislature have just a week left to wrap up a two-year budget before most of the state's ability to spend expires.

Swanson's office will be hardly alone in making its case. Dayton's office also has filed a shutdown plan of its own that differs from Swanson's and a host of entities that would be affected by the shutdown have weighed in with the court, including the League of Minnesota Cities, the state's hospitals, school districts and its public defenders.

GOP legislators also are getting in to the act, but an attempt by four of the party's senators suffered a setback Wednesday when the state Supreme Court rejected, on a technicality, their request to block the state's judicial branch from approving the spending of state money during a shutdown. A similar request will be considered by Gearin. And Republican members of the House are asking that they retain access to their bank funds.

Swanson, who filed the initial petition that got the case rolling, is asking for the creation of a special master, who would review every governmental office from township to state departments to submit descriptions of their core functions, which the state treasury would then be required to pay, per court order.

She ominously warned that unless a court keeps the state's core services running, sexual predators could be out on the streets, veterans turned out of nursing homes, unemployment checks left languishing, and there would be a "catch-and-release" criminal justice system if no judges were able to preside over hearings.

Dayton took a different position, arguing that the courts can't order the state to spend money, outside the legislative process. Dayton has taken the position that the legislature has the sole responsibility to appropriate, either by passing veto-proof budget bills or by sending him bills that he then signs. The courts, he argues, don't have that power of the purse, and, as a result, can't order spending.

Dayton has said the court "should proceed cautiously, to infringing on the inherent powers of the legislature and the governor." He has asked that some of the state's core services continue to operate during the shutdown, particularly in the areas of public safety and health and human services. He also has asked the court to appoint a mediator to oversee negotiations with GOP legislators, a request they have rejected.