After months of negotiation, Congress gave final approval Tuesday for a bill promising to restore more than $250 million a year to the nation’s historically black colleges and universities, along with other institutions that teach large shares of minority students.

The House voted 319-96 in favor of the legislation, and the Senate voted hours later to approve final changes to the bill. It will save a source of funding that expired at the end of September and now make it permanent, bringing relief to scores of schools that were bracing for the possibility of deep budget cuts.

“Today we are sending an important message of support for our HBCUs and showing in no uncertain terms that we believe they are vital to our system of higher education,” said Sen. Doug Jones, D-Ala., a member of the Senate’s education committee and one of the bill’s sponsors.

The legislation, known as the Future Act, also makes changes to simplify the Free Application for Federal Student Aid, or FAFSA, the federal form college students fill out to check their eligibility for financial aid. The legislation will make it easier for the Education Department to gather information directly from the IRS, which will reduce at least 22 questions from the form.

The FAFSA simplifications are estimated to save $2.8 billion over a decade, which will be used to pay for the annual funding to minority institutions.

Rep. Bobby Scott, D-Va., chairman of the House’s Committee on Education and Labor, said historically black colleges and universities play an outsize role in educating low-income students, yet their funding has lagged behind other institutions. Now, he said, they can rely on a guaranteed source of funding to continue their work.

In total, the legislation authorizes $255 million a year for universities that focus on serving minorities from a variety of backgrounds. It includes $85 million a year for historically black colleges and universities, $100 million for Hispanic serving institutions, $30 million for tribal schools and $40 million for a variety of other minority serving schools.

Leaders of the United Negro College Fund, which lobbied in support of the bill, called it a “once-in-a-generation” piece of legislation.

“Institutions are finally going to get the resources that they’ve always needed,” said Lodriguez Murray, senior vice president of public policy and government affairs. “We are elated and we are relieved that this funding is not only being restored for the institutions but it is being made permanent.”

The money comes from a subset of federal funding meant to expand programs that focus on science, technology, engineering and math. Previous funding had been authorized through Sept. 30 and lapsed after the Senate failed to renew it amid a dispute over other legislation. As the deadline passed, scores of schools began planning for cuts. Some had already started notifying employees their jobs or programs would be eliminated.

After the bill’s passage, leaders of several historically black colleges and universities applauded Congress for supporting both aspects of the legislation.

“The two initiatives will have a tremendous impact on ensuring that this who have been traditionally marginalized are able to have access funding to support their education and that our institutions are prepared to deliver quality educational programs and experiences,” said Patricia Sims, president of Drake State Community and Technical College in Alabama.

Although the funding itself already had bipartisan support, it became tangled in a dispute over the reauthorization of the Higher Education Act, a broad federal law that governs U.S. colleges and universities but has not been updated in more than a decade.

Sen. Lamar Alexander, R-Tenn., chairman of the Senate’s education committee, has made it his mission to pass an updated version of the law before he leaves the Senate after 2020. He has been trying to gain support for a narrow package of bipartisan bills that amounts to a piecemeal renewal of the law, but Democrats have vowed to reject anything less than a comprehensive overhaul.

When the House approved a temporary extension of the funding in September, Alexander blocked the proposal in the Senate and moved it to a separate package tied to the Higher Education Act. Democrats rejected his proposal, throwing the funding into jeopardy.

But both sides reached a compromise this week. Their deal tied the money to the FAFSA simplification, which Alexander has been pursuing for years.

’“After five years of bipartisan effort, this simplification of the FAFSA removes a huge roadblock for the millions of Americans who apply for federal grants and loans to attend college,” Alexander said Tuesday. “This bipartisan provision stops families from having to give their same tax information to the federal government twice — first to the IRS, then again to the U.S. Department of Education.”