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.