One firefighter was killed and a second was critically wounded on Friday by gunfire at a Maryland residence where the pair had answered a medical distress call, and the suspect who fired on them from inside the home was in custody, officials said.

The firefighters were responding to a call in the Washington, D.C. suburb of Temple Hills, the Prince George's County Fire Department said.

Both firefighters were in critical condition and transported to area hospitals following the evening shooting. One firefighter succumbed to his injuries later on Friday. The second firefighter, a volunteer, was in serious condition and undergoing surgery.

While details of the incident were still under investigation, the firefighters arrived at the home in the evening to conduct a routine welfare check on a resident prompted by a concerned neighbor, the department said.

"The resident in the home was not responsive so a decision was made to gain entry to the home and check on that person's welfare," Prince George's County Police Chief Hank Stawinski told reporters.

"As that was unfolding, the individual inside the home fired a number of rounds, striking two Prince George's County firefighters and the concerned individual who had led public safety to that address," Stawinski said.

The civilian was not seriously injured, he said. No police officers fired weapons. After firing several rounds, the person inside the house realized he was firing at public safety officials and stopped shooting, he said.