Maryland Gov. Martin O’Malley is on the verge of asking lawmakers to reverse an 85-year-old practice of using state tax dollars to pay the bulk of teacher pension costs, a move that could open a bruising battle with local governments in a year crowded with showdowns over same-sex marriage and raising taxes.

O’Malley (D) on Friday inched closer to saying county governments must for the first time help cover the state’s rapidly expanding teacher retirement costs, telling The Washington Post that there has to be a “balance in the shared responsibility” of funding public education.

A shift, which aides confirmed O’Malley is likely to propose, could add tens of millions of dollars in new costs to counties’ beleaguered budgets in coming years and potentially lead the General Assembly to give counties a way to raise revenue to cover the bill. O’Malley said the pension issue would have to be settled in tandem with a growing dispute between Annapolis and counties over the minimum amounts they must contribute to classrooms. Both will “need to be addressed” during the 90-day legislative session, he said.

The coming pension debate in Maryland differs from recent high-profile battles in other states, such as Wisconsin, where Democrats have spearheaded an effort to recall the state’s Republican governor, whom critics say went too far in rolling back public employee benefits and bargaining rights. Maryland had a far quieter debate last year over more modest changes O’Malley pushed through to increase how much teachers and state employees contribute and to trim what benefits they receive. The nub of this year’s fight will be who pays the tab for retired teachers — the state or the counties.

O’Malley’s comments to The Post, combined with conversations he and top aides have had in recent weeks with lawmakers, staffers and lobbyists, have led a growing number to conclude that after years of standing in solidarity with local leaders opposed to a pension shift, the former Baltimore mayor is poised to change course.

They said they expect that the annual budget O’Malley is scheduled to release Wednesday will include a seismic shift in the way the state’s annual $900 million share of retirement and pension costs is paid for 105,000 Maryland educators.

The lawmakers, lobbyists and staffers spoke on the condition of anonymity to freely discuss private conversations with the governor and his staff. The governor’s top aides declined to comment publicly on O’Malley’s budget release. However, one suggested that any plan to require counties to share in the pension costs would be phased in and require some way for local governments to raise new revenue to cover the obligation.

Whether that would mean new local taxing authority or something else was not clear. An aide said steps are included in the governor’s budget to mitigate the impact in the first year.

But county executives and lobbyists for local governments and the state teachers’ union said they were skeptical that any plan O’Malley puts forward could please everyone.

“If he shifts costs and . . . there is new revenue to support that, then maybe everyone has to take another look and keep an open mind,” said Sean Johnson, a lobbyist for the Maryland State Education Association. “But our opposition to a pension shift over the years has been that it ultimately becomes a cut in education funding. Counties are going to view it as an education expense and take it out of the same pool used for classrooms.”

Prince George’s County Executive Rushern L. Baker III (D), who was in Annapolis on Friday to strategize with lawmakers representing the county, told them that he strongly opposes a shift and that if it is implemented in the budget year beginning in July, it could add between $30 million and $80 million to the county’s $125 million shortfall.

“It’s an unfunded mandate that right now we have no way of paying,” Baker told the delegates. “I would like your help in making sure that shift does not occur.”

In an interview, Baker said he had not received word that a shift is planned.

Montgomery County Executive Isiah Leggett (D), who faces a $135 million shortfall, said continued state responsibility for teacher pensions remains the county’s top priority in Annapolis. But he said that county executives have been summoned to a meeting with O’Malley on Tuesday and that he feared bad news.

O’Malley’s budget must close a roughly $1 billion shortfall and, under a request from the General Assembly, come up with a way to make cuts for half that amount permanent.

After four years of lean budgets during the downturn, teacher pensions and Medicaid remain among the few areas O’Malley can turn to for savings of that magnitude, analysts said.

A teacher pension shift, however, has long been Maryland’s equivalent of a third rail in state politics, and if O’Malley goes forward, it could complicate his lobbying effort with counties on other priorities.

O’Malley, for example, is expected in coming days to unveil a proposal to boost funding for transportation projects, most likely through an increase in the gas tax.

House Speaker Michael E. Busch (D-Anne Arundel) has indicated that the measure’s fate in his chamber could largely hinge on the ability of county executives to rally support from lawmakers representing their jurisdictions.

But O’Malley would have at least one ready-made ally in Senate President Thomas V. Mike Miller Jr. (D-Calvert), who has been a perennial proponent of a shift.

Embracing one of Miller’s long-standing priorities could help ease the way of other O’Malley initiatives in the Senate. The governor is pushing an expansive agenda this year, including bills to jump-start the offshore wind industry and to legalize same-sex marriage, that will require cooperation from both presiding officers to pass.

Miller proposed a bill last year that called for shifting about $250 million in annual teacher pension costs to counties, calling the issue one of the great frustrations of state budgeting in Maryland.

Counties and local school boards set teachers’ salaries, but under an arrangement uncommon among states, Maryland pays the entire government share of pension costs calculated off those salaries.

In recent years, as the state has followed through on a goal of increasing school funding by more than $1.3 billion annually, counties have used some of that money to increase teacher salaries, thereby compounding state pension costs.

Maryland’s retirement system is funded at less than 65 percent of its expected obligations. It closed its last budget year, in June, with $19.7 billion in unfunded liabilities, $11.1 billion of which stemmed from teacher pension and retirement plans.

Teachers were the first participants in the state’s retirement system in 1927, and there are far more teachers than state employees in the system.

Altering it would mark a turning point for O’Malley, who has resisted calls to do so. Maryland’s teachers were among O’Malley’s biggest backers in his 2010 reelection, and nationally, teachers are a potential well of support for the term-limited governor, who is widely seen as having ambitions beyond Annapolis.

As recently as a year ago, O’Malley won a standing ovation at a gathering of the Maryland Association of Counties for pledging to stand with local leaders on the teacher pension issue, saying county budgets were not able to absorb the cost.

He then went on during last year’s legislative session to push through pension changes, saying they were a prerequisite to any discussion about shifting part of the cost to the counties.

Those changes required teachers and state employees to increase from 5 percent to 7 percent the share of salary they pay into the state system. It put the system on track to fully cover its outstanding obligations by 2031, three years earlier than without the changes.

O’Malley suggested Friday that any pension shift will be paired with a fix to the state’s “Maintenance of Effort” requirement, which mandates that counties budget at least as much for education annually as they did the year before. A loophole recently added to the requirement is expected to prompt seven counties this year to reduce funding without state approval.