Chanting “keep the promise” and “hands off our pensions,” thousands of Maryland teachers and public employees descended on the State House in Annapolis on Monday night to protest budget cuts and higher employee pension costs proposed by Gov. Martin O’Malley (D).

Teachers charged that the governor’s budget, which would close a $1.6 billion gap partly by freezing education funding, abandons a hard-fought law mandating annual increases to improve the state’s classrooms.

State workers, railing against O’Malley’s pension proposal, turned the governor’s winning re-election slogan from last fall back at him: “Forward, not back,” they yelled.

“I hate to do this to the governor, he’s one of us, he’s a union guy,” said Bob Dickerson, a University of Maryland employee, as he jostled for a view two blocks deep in a section of the crowd clad in green emblazoned with logos of the American Federation of State County and Municipal Employees, Maryland’s largest public employees union.

“But I make $35,000 after working the same job for 35 years and you’re telling me I’m the problem with the budget?” Dickerson said. “You’re going to cut my pension? That’s wrong.”

Against the advice of some staffers and event organizers, O’Malley took the protest head-on.

Near the end of the rally, he emerged from the State House and took the stage immediately after a fist-pumping address by AFL-CIO President Richard L. Trumka, who had been a fixture in recent weeks at union protests outside the Wisconsin state house as the Republican governor there sought to eliminate public employees’ collective bargaining rights.

“Good evening, Maryland,” O’Malley said, first to a smattering of boos and then a swelling chant of “keep the promise.”

But O’Malley quickly disarmed much of the crowd, saying he didn’t want to hurt public employees and was not at all like his Republican counterparts in the Midwest.

“I don’t like this budget either,” he said, “but I wanted to come here and say this: Our state is not like other states.

“We are a great state ... because our public employees do a good job every single day,” he said to hearty applause. “You will not find in Maryland the sort of Midwestern repression that goes on in places like Wisconsin . . . Ohio, that are doing away with collective bargaining.”

O’Malley then offered the near exact words Maryland State Education Association President Clara B. Floyd said earlier in the evening that she wanted to hear.

“Look we have tough decisions ahead of us,” O’Malley said. “But we are committed to staying at the table, and figuring this out together” with the unions, he said.

After O’Malley got off stage, he saw Trumka waiting to speak and embraced him. O’Malley then posed for pictures with union members and others.

In an interview, Trumka said the protest by unions and cooperative spirit displayed by O’Malley is ”the way it’s supposed to work.”

“Now,” Trumka said, “we negotiate.’’

Staff writer John Wagner contributed to this report.