Almost 20 dogs graduated from an intensive MTA training on terrorism and explosives Wednesday at Grand Central Terminal. They were named after police officers and soldiers killed in the line of duty, and the mood was somber following the fatal shooting of a cop in East Harlem the night before.

Marge Dwyer, 73, of Elmont said it was difficult to hear about Police Officer Randolph Holder, and that she had prayed for him. Her rookie son Anthony Dwyer, 23, was slain in 1989 when he fell from the rooftop of a midtown building duirng a struggle with a robbery suspect. One graduating canine was christened "Dwyer" in honor of her child.

"It all comes back," she said. "It's just so sad when you hear it and you always hope for the best, you pray."

MTA Police Chief Michael Coan said the canines in the cermeony honored the officers and soldiers who made the ultimate sacrifice.

"We are reminded of the dangers that police officers face," he said.

The graduating class of dogs spent 12 weeks on a rural Dutchess County campus in Stormville before joining law-enforcement. Fifteen canines joined the MTA Police Department and will patrol the LIRR, Metro-North Railroad and Staten Island Railway.

Four will serve in the United States Park Police and the Putnam County Sheriff's Office.

Detective James Zadroga, who died of respiratory disease following rescue efforts at Ground Zero, was also honored during the graduation ceremony. One canine was named "Droga" after him.

"We were proud and honored that they would name a working dog after my son," said Joseph Zadroga, 68. "I hope he has a distinguished career as Jimmy did."

Most of the dogs were German shepherds, but there were breeds like the Labrador retrievers and Belgian Malinois as well.

The MTA has 50 total dogs working in law enforcement. Last year, the canines inspected and cleared about 2,600 unattended packages. They responded to almost 26,000 calls for assistance in 2014.

"Canines can do in minutes what can take hours for humans to do when searching for explosives or other evidence in crimes," said MTA spokesman Aaron Donovan.

Others that were honored included Police Officer Stephen Driscoll, who died on 9/11 trying to rescue people trapped in the World Trade Center, and Police Officer John Scarangella, killed in a traffic stop in Queens in 1981.

The Tails of Hope Foundation was also recognized during the ceremony. The group helped raise money last year to buy bulletproof vests and cameras for the canines.