FRANKFORT, Ky. (AP) — The bill U.S. lawmakers passed early Friday to keep the government open also protects a pair of small Appalachian colleges in Sen. Mitch McConnell's home state.

Berea College in eastern Kentucky does not charge tuition and only accepts students who cannot afford to pay. The school relies mostly on its $1 billion endowment. But the Republican tax plan that passed last year included a tax on the school's endowment that would have cost it $1 million a year and forced it to accept fewer students.

Meanwhile, students at Southeast Kentucky Community and Technical College are in danger of losing access to federal student loans. That's because between 2014 and 2017 — a three year period known as a "cohort" — 33.6 percent of the colleges' former students have failed to repay their federal student loans. The college's past three cohort default rates have exceeded 30 percent, violating federal law and placing the schools funding at risk. Losing those fund would make it difficult for the school to stay open.

But tucked inside the $400 billion spending measure Congress approved early Friday morning was language exempting Berea College from the endowment tax. And the bill included language that would let the Secretary of Education waive penalties for colleges in economically distressed areas, which would include the eastern Kentucky mountains hit hard by a declining coal industry.

"We are very grateful for leader McConnell's support for southeast students and remain hopeful that a resolution can be found to this difficult circumstance," said Amy Simpson, spokeswoman for Southeast Kentucky Community and Technical College President Vic Adams.

Berea College was a casualty of partisan rancor in Washington and held up as a symbol of the unintended consequences of quickly enacting sweeping tax law changes. The tax bill President Donald Trump signed into law in December included a 1.4 percent tax on endowment earnings of private colleges with at least 500 students.

The tax bill originally included an exemption for Berea College because of its unique mission. But the exemption did not comply with Senate rules and had to be removed. Republicans blamed Democrats, who refused to vote to suspend the rules so lawmakers could keep the exemption in place. Democrats blamed Republicans for rushing through a bill that did not adhere to the Senate's rules.

The language exempting Berea College from the tax was included in the budget bill at the insistence of McConnell, according to a spokesman.

"After Senate Democrats' removed Berea's protection, I made a promise to help the students and the school," McConnell said in a news release. "I am proud to have worked with my colleagues, especially Congressman Andy Barr, to fulfill my commitment to these students."

McConnell's mention of Barr is significant. Berea College is in Barr's central Kentucky congressional district, and the three-term GOP congressman is up for re-election in 2018. Democrats are targeting his district, which includes the state's second-largest city and has flipped between Democrats and Republicans five times since 1979. Barr is facing a Republican primary in May, plus six Democrats have filed to challenge him in the general election.

"I secured a public commitment from House leadership to amend the law to prevent application of a tax on Berea College," Barr said in a news release. "Today, I am proud that the House and Senate have delivered on that promise."

Democratic candidate Amy McGrath, a former fighter pilot for the Marine Corps, said it was "ridiculous to take credit for exempting Berea college when they are the ones that actually taxed them in the first place."

"Why are they even taxing endowments on any college?" she said. "It's the wrong priorities."

Founded in 1855 by an abolitionist ex-Presbyterian minister, Berea College distinguished itself as the first interracial, coeducational college in the South. Its students mainly come from the eastern Kentucky, which have been economically devastated by the decline of the coal industry. About 64 percent of its students have parents who don't have four-year degrees.

Berea College President Lyle Roelofs traveled to Washington earlier this week to meet with McConnell.

"At Berea, none of our 1600 students pay tuition, and we are grateful for Senator McConnell and Congressman Barr's work to address this new tax liability, which would have forced us to scale back our mission of educating students who would not otherwise be able to attain a college degree," he said.