The House on Thursday approved more than $66 million to replenish the District’s emergency security fund, which was repeatedly depleted as costs spiked for protests and other events during the Trump administration, including the Jan. 6 Capitol breach.

The federal funds are allocated to the District so it can coordinate and staff major events related to the federal presence in the nation’s capital, such as demonstrations near the White House, presidential parades and the quadrennial inauguration.

City officials said the federal government left the fund dangerously under-resourced while President Donald Trump was in office, even as his tenure unleashed a wave of mass demonstrations on Washington’s streets.

Then came a summer of racial justice protests, a tense and sometimes provocative federal response, and a mob of Trump supporters who breached the Capitol as Congress was certifying President Biden’s electoral victory.

The $66.7 million that the House passed to replenish the fund Thursday “is an attempt to catch up,” said Del. Eleanor Holmes Norton (D), the District’s nonvoting representative in Congress.

The money was included in a $1.9 billion emergency supplemental spending bill that narrowly passed the House on Thursday, amid partisan fighting over both the legislation and a companion bill — passed Wednesday — to establish an independent commission to investigate the events of Jan. 6.

The spending bill aims to beef up the Capitol’s security infrastructure while also reimbursing agencies that responded to the riot, including the D.C. police, Capitol Police and National Guard.

The $66.7 million that would go into D.C.’s emergency planning and security fund would both eliminate the fund’s deficit and provide more money to cover projected costs for the rest of fiscal 2021, said Chris Rodriguez, director of D.C.’s Homeland Security and Emergency Management Agency.

“It was the D.C. police who saved the day at the Capitol, instead of D.C. saying, ‘Well we’ve got a deficit, let them fight it out amongst themselves,’ ” said Norton.

It’s unclear whether the spending bill, which passed 213-212 with no Republican support, will be approved by the narrowly divided Senate. Rep. Bob Good (R-Va.) proposed amendments in the House on Tuesday seeking to cut the payment to the District and divert spending on Capitol security to fund a wall on the country’s southern border. His amendments were not debated or voted on.

House Democrats failed to close ranks around the bill, with some in the party’s growing liberal wing, including members who have called for reduced funding for police, voting “no” or “present.” Republicans questioned the cost of the bill and said Congress had not done enough to guarantee the money would be spent wisely.

Norton and D.C. officials have been sounding the alarm about a growing deficit in the emergency planning and security fund since 2017.

Congress had allocated $20 million to fund the city’s security efforts during Trump’s inauguration. But the event ended up costing D.C. $27.3 million.

The city repeatedly asked Congress and the Trump administration to reimburse the extra $7.3 million. The money never came.

Then Trump decided to host a Fourth of July celebration in 2019, featuring military flyovers, armored vehicles displayed on the National Mall and a lengthy presidential address that drew thousands to the capital.

In a letter to the president afterward, Mayor Muriel E. Bowser (D) said the event had bankrupted the emergency security fund, which she said would probably be running a $6 million deficit by September, the end of the fiscal year.

Rodriguez said Tuesday that part of the problem is that the costs of responding to major protests and events in the capital spiked in the Trump era — but Congress did not increase the yearly payments accordingly.

That problem couldn’t be starker than in 2020. D.C. spent an estimated $61 million on events related to the federal presence, including $40 million in police overtime during the demonstrations sparked by the murder of George Floyd.

But the city had been allocated only $18 million. Officials diverted nearly $36 million in local funds from three D.C. agencies to cover the costs — money that would be repaid to the District through this spending bill.

Rodriguez declined to provide an estimate on the costs of Jan. 6 and its aftermath “for operational security purposes,” saying some of the security measures are ongoing.

But he said the District has been able to avoid taking local taxpayer dollars to fund federal security and planning so far in fiscal 2021, largely thanks to an additional nearly $16 million Federal Emergency Management Agency reimbursement related to the inauguration. Trump had approved a disaster declaration for D.C. after Jan. 6, allowing D.C. to recoup some of the costs associated with preparations and staffing ahead of the inauguration.

Still, he said, the $66.7 million will ensure D.C.’s fund doesn’t run red for the rest of the year.

“We are happy to see that the House has recognized in this bill that we as Washingtonians can’t foot the bill for security support we provide to federal agencies,” Rodriguez said. “I think the events of Jan. 6 are a perfect example of that.”