Two Philadelphia police officers were shot overnight, officials said. 

The 19th district officers responded to the 100 block of North 52nd Street around 12:22 a.m. on Saturday for a report of a man with a gun on a porch.

When they arrived, the gunman opened fire, shooting both officers, officials said.

One of the officers, a 33-year-old, was shot 12 times while the second officer, a 40-year-old, was shot three times, according to investigators.

Both officers were taken to Presbyterian Hospital where they underwent surgery.

A SWAT team and other police officers responded to the shooting where they found the gunman in a tree, officials said. The man — who was in possession of both his own gun and the weapon of one of the officers —- was taken into custody. Officials have not yet revealed his identity.

NBC10 is working to learn more.