WITH LITTLE warning and no credible explanation, legislative leaders in Annapolis have declared war on local governments and their prerogative to set priorities.

In thrall to the power and money of state and local teachers unions, they have conjured legislation that would force jurisdictions such as Montgomery County to divert tens or hundreds of millions of dollars to one, and only one, area of local government: schools.

The legislation would empower the state to seize local tax revenue and redirect it exclusively to inflate school budgets — mainly meaning teacher salaries, pensions and benefits. It would do so even if it meant overriding voter-adopted property tax limits or raiding funds for police, fire departments, libraries, parks and transportation. Montgomery and some other counties, which already spend more than half their budgets on schools, would be largely stripped of their discretion to set spending priorities.

As an example of the legislation’s absurdity, consider: In Montgomery alone, it would shift an additional $18 million to $129 million in local tax dollars to schools next year. That’s more than the county schools superintendent has requested, or says he needs, in a proposed $2.1 billion budget for fiscal 2013. That budget already includes pay increases for teachers well beyond those being offered to police officers, firefighters or other county government employees.

The legislation, backed by House Speaker Michael E. Busch (D-Anne Arundel) and Senate President Thomas V. Mike Miller Jr. (D-Calvert), is being promoted by teachers unions. They are angry that a handful of fiscally strapped localities, foremost among them Montgomery, have avoided state-mandated increases in school spending, based on enrollment growth, the past few years.

The issue has its roots in a law, enacted a decade ago, that pumped some $1.3 billion in new spending into public schools. To ensure that local governments would not slack off while the state stepped up, lawmakers required localities to maintain their own spending on schools — or increase it if enrollment rose.

In practice, many local governments funneled more to schools than the state required; in the past decade, Montgomery spent some $576 million over and above the state’s “maintenance of effort” formula. Some 90 percent of the county’s school spending went to personnel, mainly teacher salaries, pensions and benefits.

Then the recession hit. Localities in Maryland, as elsewhere, slashed spending — though less for schools than almost every other area. A handful of jurisdictions were subject to penalties for failing to meet “maintenance of effort” formulas, even if, like Montgomery, they had far exceeded those mandates in past years.

Now lawmakers are fashioning a fix that would make things profoundly worse. It takes no account of localities that have exceeded state mandates in the past and gives no credence to local discretion. It would arrogantly ignore tax caps that voters have adopted, all for the purpose of creating what the Maryland Association of Counties, which opposes the legislation, calls “an infinite loop of unsustainable spending.”

What a terrible idea. Gov. Martin O’Malley (D), a former mayor of Baltimore, should break his silence and speak out for a common-sense solution that would not break the backs of local governments.