The beleaguered Philadelphia School District, which has hobbled on the brink of collapse all school year, staved off another round of draconian cuts with a last minute reprieve by the City Council.

The council on Thursday, during its final meeting of the year, agreed to borrow $30 million to help patch the district’s woefully-wide funding gap. The 11th-hour nod came on the heels of pleadings by the school district, rancorous debate among council members and student-led protests at City Hall.

“These are not just budget cuts. This is not about belt-tightening. The unjust funding of Philadelphia’s public schools is the moral calling of our time.” Parents United

The $30 million agreement will go toward chipping away at the district’s $216 million deficit. The latest funding is likely a Band-Aid. The district has said it needs upward of $320 million to buoy a district in such bad financial shape that Mayor Michael Nutter has had to make public pleas for school supplies and where most public school students don’t have access to full-time nurses or libraries.

Ahead of Thursday’s vote, School superintendent William R. Hite Jr. pleaded with city and state lawmakers, saying that the district needed an additional $96 million to deliver even a “wholly inadequate” education the coming year.

Inadequacy has been par for the district for years, but the latest crisis came to a head before the start of the school year even began, when the district laid-off about 4,000 employees and shuttered two-dozen public schools. The closings sent thousands of school children to different schools, sometimes along dangerous routes in unfamiliar neighborhoods.

The start of the school year was then threatened under great budgetary restraints, and only opened on schedule after the city agreed to borrow $50 million to ensure that school doors would open on time.

The district has been flailing ever since. The latest agreement brings total borrowing by the City Council for the school district to about $57 million, $27 million of which was passed at Thursday’s meeting and the addition $30 million that will be officially voted on when the Council reconvenes in September.

There’s also been frustration among many of the city’s school and student advocates who say that while the agreement will go a long way in aiding schools, it’s funding that had been promised almost a year ago. The Council determined that the district, after selling off district-owned property, did not need the entire $50 million in funds it had agreed upon at the beginning of the year. It instead set aside about half that amount. The $27 million passed on Thursday is basically the other half of that funding.

“The burden of this fiscal crisis should not fall on the city of Philadelphia” Jerry Jordan, president of Philadelphia Teachers Federation

Up until the final vote on Thursday, Council leaders said they would not borrow the additional funding because the city and the district had not followed a Council-approved plan to transfer the $50 million to the school district that included the district’s portfolio of shuttered school buildings.

“They opted not to take that direction, so it’s a self-inflicted wound,” Council President Darrell L. Clarke, told Philly.com just two days before the Council reversed course. “The School District had an opportunity to access $50 million last year, and they chose not to do that.”

Helen Gym, co-founder of Parents United for Public Education, said she was thankful for the Council’s efforts but that the funding falls far short of the district’s needs.

“We’re glad that we are able to move forward on last year’s promise, but it’s a one-time borrowing cost and it’s not sustainable revenue,” Gym told msnbc. “So we still have an enormous budget gap as we are wrapping up the budget season, so all of our attention has to be narrowing that massive budget gap.”

In addition to closing that gap, Gym said schools need funding to restore a litany of essential school personnel, including assistant principals, counselors, nurses and aides all lost to layoffs over the summer.

The district has been beset with controversy, including the deaths of two students, a 7-year-old boy and a 12-year-old girl, both of whom fell ill at public schools where no nurse was on duty and later died.

“Despite the challenges of any budget effort, it’s important to understand that children and school staff are the ones who really suffer the consequences of failing to fund schools,” Gym’s group, Parents United, said in a statement. “These are not just budget cuts. This is not about belt-tightening. The unjust funding of Philadelphia’s public schools is the moral calling of our time.

Meanwhile, Superintendent Hite applauded the Council’s decision, calling the agreement “gigantic” and one that “closes the gap pretty significantly.”

“While we continue to look for every source of additional revenue, we appreciate the City Council’s steps to help ensure that young Philadelphians will have access to quality instruction, resources and support,” Hite said in a statement. “Our crisis demands urgent actions and we are thrilled that the City Council responded in kind.”

Hite said that efforts will now be focused on lobbying state lawmakers to, among other things; allow a $2 tax on cigarettes that could be used to supplement the school district.

Jerry Jordan, president of the Philadelphia Teachers Federation, said the agreement is a step in the right direction but added that “the burden of this fiscal crisis should not fall on the city of Philadelphia.”

“The State Legislature and the [Gov. Tom Corbett] administration have the authority to provide resources that would take Philadelphia and other Pennsylvania school districts out of crisis mode,” he said. “It’s time for them to use the power they have to mandate adequate and sustainable funding for all of Pennsylvania’s public schools.”

Since taking office in 2011, Corbett has cut $1 billion from statewide education funding.