Two school libraries, shuttered last month due to budget cuts, will reopen Tuesday after a donation from an anonymous donor.

As The Inquirer reported last month, Central High and Masterman, two of the city's most prestigious schools, closed their libraries because the district did not fund librarians.

Principals of the two schools, magnets that take in top students from across the city, lamented the closures, and said the budget cuts had taken aim at the very heart of their institutions.

After reading the newspaper story about the library closures, the donor decided to contribute $205,000 to help them reopen, said Fernando Gallard, spokesman for the Philadelphia School District.

The money, from a donor who asked to remain anonymous, was donated through Philadelphia's Children First Fund, a nonprofit that supports the city's public schools. The donor "read the story in the paper" and reached out to the nonprofit about providing money to reopen the libraries, Gallard said.

"It's outstanding that we have individuals stepping up," he said, adding that the district was "extremely grateful" and surprised by the gift.

The contribution will cover the salary and benefits of the two librarians for the remainder of the school year, Gallard said Thursday.

Based on seniority, the two had been reassigned to other schools to do nonlibrary work. Gallard said he did not know if their library reinstatements would allow for the district to rehire any laid-off employees to fill their current positions.

He said the district would soon announce several projects intended to bolster library services.

"We are working as a district to actually find more sources of funding for libraries, especially in high-need schools," Gallard said.

As a result of this year's budget cuts, there were only 15 librarians left in the district. In 2011, the district had 65 librarians. In 1992, it had 176.

The loss of the librarian at Central was all the more painful since the school had opened a new $4.5 million library in 2005 funded by alumni.

Students visited Central's library 147,000 times last year.