The Buffalo teachers union and district officials reached an agreement on a teacher evaluation plan Tuesday night at the union’s Porter Avenue headquarters – likely staving off the loss of $33.4 million in state aid, at nearly the last minute.

The agreement still has to pass muster with the state Education Department by Thursday if the district is to salvage the millions in state aid to Buffalo schools that is contingent on having an approved evaluation plan in place by then.

“Department staff is available around the clock to review submissions,” state Education Department spokesman Jonathan Burman said in an email. “We will review any plans we receive between now and [Thursday] as expeditiously as possible, but we will not sacrifice quality for speed.”

Officials from both sides said they were pleased with the plan.

“I think it’s a fair agreement,” Buffalo Teachers Federation President Philip Rumore said. “There’s compromise on both sides.”

In a statement emailed about an hour and a half after the agreement was signed and submitted to Albany, Superintendent Pamela C. Brown said state officials had already begun reviewing the pact.

Brown said the district looks forward to feedback from the state Education Department.

“We are hopeful to gain approval on this evaluation agreement at the earliest possible moment,” she said.

The district also is thankful to state education staff for their willingness to handled the district’s request for an expedited review so close to the deadline, she said.

Buffalo was one of 13 districts statewide late Tuesday still needing to modify its plan and resubmit it to earn state approval. Another five districts, including New York City, had not submitted a plan as of Tuesday evening. And Hamburg had submitted a plan – but its union had not agreed to it.

Most of the 669 districts whose plans have been approved have submitted one-year agreements, state officials said. Buffalo is among about 10 percent of districts to submit a two-year plan. The district’s agreement, though, contains a provision stipulating that either side can reopen negotiations for the second year, Rumore said.

He signed the agreement about 8:45 p.m., contingent on approval by either the union’s Council of Delegates or its entire membership, he said. The agreement will be presented to the Council of Delegates at its Thursday evening meeting. After that, it will be emailed to all the teachers in the district. The Council of Delegates will vote on the agreement sometime in February, Rumore said.

He declined to release a copy of the agreement until it has been sent to teachers. A district spokeswoman also declined to release the plan Tuesday night.

According to Rumore, Buffalo is using Binghamton’s plan as a model for some portions of its evaluation agreement. Binghamton was one of the first districts to have its plan approved and then held up by state officials as a possible model for other districts.

One of the key elements that Buffalo is borrowing from that plan is a method for factoring in high concentrations of student poverty, students with special education needs, and students whose native language is not English.

The higher the concentration of students in one or more of those groups, the lower the goal for student achievement. In a class with few students in one of those groups, 80 percent of students would be expected to meet a certain level of proficiency – for example, earning a certain score on the state’s English test, under Binghamton’s plan. The more high-need students there are in a particular class, the lower the percentage of students expected to reach proficiency.

In a class with the greatest population of students in those groups, only half the students – rather than 80 percent -- would have to meet the level of proficiency, under Binghamton’s plan.

In Buffalo, union leaders and district officials spent much of Monday and part of Tuesday negotiating at Buffalo Teachers Federation headquarters on Porter Avenue.

Superintendent Brown was not directly involved in negotiations. The district was represented by Kelly Eisenried, executive director of labor relations; Debra Sykes, associate superintendent for school innovations and turnarounds; and Genelle Morris, assistant superintendent for shared accountability.

The union was represented by Rumore; Edith LeWin, vice president; Barbara Bielecki, presidential assistant and treasurer; and Nick Whitman, Deana Fox and Dennis Licherelli, labor relations specialists.

“One of the things that made it somewhat easier for both negotiating teams is that there was trust,” Rumore said. “We didn’t have to go into another room and hide and whisper to one another when we wanted to discuss something.”

Districts that do not have an approved evaluation plan in place by Thursday will forfeit this year’s increase in state aid. For Buffalo, the amount in question is $33.4 million.

As of Tuesday evening, 97 percent of the districts in the state had an approved evaluation plan, according to Tom Dunn, a spokesman for the state Education Department.