Nearly 30 Boston firefighters with pending disability claims filed for retirement yesterday, just two days before a new state law ends a controversial benefit that allows them to significantly enhance their pensions if they claim career-ending injuries occurred while filling in for a superior at a higher pay grade.

Of the 29 who filed yesterday, 25 said they were filling in for a superior at the time of their injuries, according to city officials, which makes them eligible for a pension benefit at the higher salary scale. That perk, which can add hundreds of thousands of dollars over a retiree’s lifetime and cost taxpayers millions, will not be available to anyone filing after today.

“This is highly unusual,’’ said Kathleen Kiely-Becchetti, executive director of the Boston Retirement Board, of the number of firefighters who filed for retirement yesterday while their disability claims were still pending.

The race to file yesterday is the first obvious reaction to the sweeping pension law that was passed by the Legislature and signed by Governor Deval Patrick earlier this month. The claims filed by the firefighters yesterday - and an expected rash of new claims today - could cost Boston taxpayers millions in additional payouts at a time of major budget constraints, fire officials said.

Boston Fire Commissioner Roderick J. Fraser Jr. said firefighters are clearly taking advantage of the final days before the new clampdown on enhanced pensions goes into effect.

“The old system provided a financial incentive for people to file for accidental disability while they were filling in for supervisors,’’ he said. “This illustrates that fact.’’

Suspected disability retirement abuses and pension excesses have been a chronic problem at the Boston Fire Department, prompting an inquiry by the FBI.

A Globe review of city retirement and payroll records last year found that, over the prior six years, 102 Boston firefighters had substantially enhanced their tax-free disability pensions by claiming career-ending injuries while they were filling in for superiors at higher pay grades. Some firefighters have sought the enhanced benefit after filling in for a superior for just one day, leading critics to call it the “king-for-a-day’’ provision.

Boston retirement officials said that there are 68 firefighters with pending disability pension claims. Starting tomorrow, firefighters who file for disability pensions would see their retirement checks based on their average salary from the 12 months prior to their injury.

State fire union officials have been working hard to warn members about the new law, blasting e-mails and holding meetings with them, to make sure they understand that they will lose the opportunity to file for enhanced pension benefits if they do not file for retirement by today.

“It’s caused a lot of consternation with members . . . it’s complicated and they’re nervous,’’ said Robert B. McCarthy, president of the Professional Firefighters of Massachusetts. “They don’t want to hurt their families and their pensions.’’

Officials from Boston Firefighters Union Local 718, which represents the city’s firefighters, did not return calls.

The 29 firefighters who applied for retirement yesterday had been out on injured leave, collecting 100 percent of their pay, tax-free, pending the approval of their disability claims. Now that they have filed for retirement, the firefighters will instead receive 80 percent of their salary in pension benefits, saving the city money while their disability claims are pending.

All firefighters who apply for disability benefits have to have their application approved by a panel of doctors and by Boston retirement officials.

Those whose disability claims are eventually approved will receive 72 percent of their salary tax-free for life. Those who were filling in for a supervisor and got their retirement application in before the new law takes effect tomorrow would receive a pension based on their supervisor’s salary.

Even before the new law takes effect, union officials have been lobbying leading lawmakers to roll back one of its key provisions.

McCarthy has already met with Senate President Therese Murray, Senate Ways and Means chairman Steven C. Panagiotakos, and a top House lawmaker to push for changes. McCarthy has proposed an amendment that would change the way firefighters’ pensions are calculated, opening the door for them to again receive benefits based on their superiors’ pay.

McCarthy argued that the new law unfairly punishes all injured firefighters, not just those who claim injury while filling in for superiors.

“I don’t think they intended to punish every firefighter who gets injured in the line of duty, and that’s what it does,’’ McCarthy said of the new law. “How am I going to tell my guys to fight a fire and risk their lives if they’re not going to be protected?’’

Boston officials strongly oppose McCarthy’s amendment, which they say would undermine the new law.

“People should not be fooled,’’ said Dot Joyce, a spokeswoman for Mayor Thomas M. Menino. “What the Legislature did in closing this loophole is not only appropriate, but in the best interests of the taxpayers.’’