It happened just before 6 a.m. Wednesday on the 500 block of West Somerville Avenue near North Fairhill Street.
According to police commissioner Danielle Outlaw, an officer went upstairs to check on a possible victim when a person began shooting at the officer and another man.
The 68-year-old man was shot once in the neck, police said. He was taken to Einstein Medical Center where he was listed in stable condition.
Officers also found a 38-year-old man who had been shot twice in the head. He was also taken to Einstein Medical Center where he is currently listed in critical condition.
Police declared a barricade at 6:09 a.m., and the Philadelphia Police Department SWAT Unit was called to the scene. Officers were able to clear the house by 6:46 a.m.
A person was arrested and a weapon was recovered, police said. Officers did not fire their weapons.
No officers were injured.
The investigation is ongoing.