The trillion-dollar federal spending deal being debated on Capitol Hill includes a significant new provision for the District’s government, exempting most of its spending from potential federal shutdowns until late 2015.

Previous shutdowns, including the one last October, have threatened city services such as trash collection and public schooling because the city’s budget must ultimately be appropriated by Congress.

The fact that basic services funded by local tax collections were put at risk by congressional wrangling led to a series of unprecedented moves by Mayor Vincent C. Gray (D) in October, including an initiative to declare all city employees “essential” and thus exempt from furloughs, as well as a decision to tap an emergency reserve fund to bankroll operations until Congress came to terms.

The city’s defiance culminated in a dramatic encounter on the Capitol steps midway through the shutdown between Gray and Senate Majority Leader Harry M. Reid (D-Nev.), with the mayor demanding the city be freed from the impasse.

In the deal that ended the October standoff, Congress agreed to keep the District government immune from federal shutdowns through Sept. 30, the end of the fiscal year.

Now, with Congress poised to approve a new omnibus appropriations bill by week’s end, the city could win the right to spend locally collected tax dollars through the following fiscal year, even if there is another funding dispute on Capitol Hill.

If language contained in drafts circulated Monday becomes law, it would be the first time a full-year federal spending bill exempted the District’s local funds from shutdowns.

The provision was hailed by local and congressional leaders, with District congressional delegate Eleanor Holmes Norton (D) calling it in a news release “historic and unprecedented” and a “significant step forward in our fight for full home rule and budget autonomy.”

Gray called it “a huge step toward the day when our 647,000 residents are allowed to spend our own money without congressional approval.”

The language was proposed by Senate Democrats and accepted by House Republicans in the final compromise bill, according to officials familiar with the process who were not authorized to comment publicly on the matter.

One of them, a Senate aide, credited Gray’s visibility during the shutdown with “help[ing] to elevate this issue in a lot of people’s minds.”

“It’s hard to justify the city not having that basic level of autonomy with its own funds,” the aide said.

It remains to be seen whether a referendum passed by D.C. voters last year renders the new language moot.

Backers of the April vote for budget autonomy say it means the city is now free to spend its local funds as it wishes. But congressional Republicans have rejected that interpretation, and the matter is under review by the Government Accountability Office.

A summary of the omnibus bill circulated Monday by House Republicans specifically noted that the compromise bill does not include broader Senate language allowing District budget autonomy.