Third grade student Antowne Turner practices on xylophones at Patterson Elementary School in Washington, D.C. on Dec. 17, 2013. (Bonnie Jo Mount/The Washington Post)

Nicole Anderson figured it would take her about four years to raise enough money to buy the musical instruments she needed to give her students at Southwest Washington’s Patterson Elementary School the instruction they deserved.

And then, one day this fall, Anderson’s timeline changed. A truck pulled up outside the school and unloaded boxes upon boxes of the instruments Patterson’s music teacher had hoped for: xylophones, bongos, tambourines, bells, triangles and maracas.

“I was ecstatic,” said Anderson. “It was beyond my wildest dreams of what I was going to get.”

D.C. Public Schools announced this month that it purchased 4,000 new musical instruments for schools around the city, as well as 2,000 desktop computers, more than 1,300 laptops and tablets, art supplies and science lab equipment.

The school system also bought 85,000 new books for school libraries around the city, an investment that comes after years of pressure from parents and activists.

The new materials cost about $10 million, from money that had been left unspent because of unfilled personnel vacancies and reduced benefits costs, officials said.

“When we realized these funds would be available, we came up with a thoughtful and strategic plan to make purchases that would both help our students learn and achieve, and support our teachers with new, modern equipment and supplies,” Schools Chancellor Kaya Henderson said in a statement. “The action at DCPS is in the classroom, and that’s where we’re putting our resources.”

Several renovated and rebuilt schools, which opened with brand-new libraries but very few books, received full collections. They included Anacostia High School, Kramer Middle School and the McKinley and Cardozo Education campuses.

But every school in the city received some new books, and the infusion of current titles came as a thrill to librarians who are used to holding book sales and soliciting donations in order to improve aging collections.

“It’s wonderful,” said Currie Renwick, the librarian at Watkins Elementary on Capitol Hill, which received more than 200 fiction and nonfiction titles. “We’re just so pleased. . . . For many children, there are not books at home, so it’s critical we have the best books that we can get.”

Renwick said that before the new books arrived in November, the average copyright date in the Watkins library was around 1994, a vintage that is “unacceptable,” she said. Science books, in particular, need refreshing more often, she said.

“You know the phrase, ‘You can’t judge a book by its cover’? That is true to some extent, but you certainly can judge a nonfiction book by its copyright date,” Renwick said. “And with fiction, you have to have fresh material.”

Renwick said she’s hopeful that in the future, the school system will make a practice of earmarking money in the budget for library materials.

Peter MacPherson, a parent who has long pushed for more investment in and attention to school libraries, said the libraries will need a regular influx of dollars in order to update their collections. But he described this infusion of books as “a fabulous development.”

“The work is not done, but it’s a great, great first step,” he said.

The school system is considering the possibility of budgeting for regular updates of library and other materials, spokeswoman Melissa Salmanowitz said.

The new musical instruments were just as welcome as the books. On a recent afternoon at Patterson, third-graders eagerly volunteered to play the new xylophones, the new tinkling triangles and — especially — the new bongo drum.

“You just hear a beat and you go with it,” Paris Mercer, 8, said. “That’s what I like.”

Paris said that last year, and in years past, music class was filled with singing. There were no instruments.

“They like singing, but if you do singing for six straight years, they get a little zoned out,” said Anderson, who is in her first year teaching music at Patterson.

She started the year with homemade instruments she had built for her students, such as rattles made of tennis balls filled with beans. D.C. students deserve better, she said.

“Our goal is to have our classroom look like it would if you went out to Fairfax County or other places where families have a lot of money,” she said.