Sternbeck identified the deceased officer as Maurica Manyan, 25, of Indian Head, Md., in Prince George’s County.
Porter was being held Friday morning. It was not immediately possible to determine if he had a lawyer.
The shooting occurred around 3:30 p.m. at the Anacostia Neighborhood Library in the 1800 block of Good Hope Road SE.
Police said the Porter was hired by the library to train some of its officers in the use of the expandable batons. Police Chief Robert J. Contee III said it was unclear why an actual firearm was involved in the training, but “it is not good practice to do so.”
The library police officer, who was shot near the end of the training session, was pronounced dead in a hospital, police said.
“It’s a very tragic situation that we’re facing here,” Contee said.
The chief said about six people were in the room at the time of the incident, including the trainer, the victim and several other library officers.
The DC Public Library is an independent city agency with its own police department. Its officers, who are authorized to carry weapons, are responsible for public safety in libraries, library system spokesman George Williams said.
Thursday at the library was supposed to be a “job readiness” day, where neighborhood residents could stop by for help setting up their emails and preparing their resumes. By evening, the library had posted signs on the door stating that the building was closed due to an emergency.