Two women were rescued from a hostage situation Monday morning at a UPS facility in New Jersey, a prosecutor said. Gloucester County Prosecutor Charles Fiore told reporters the women appeared to be unharmed.

The armed man who took the women hostage was shot after emerging from the facility in Logan Township, about 20 miles south of Philadelphia, officials said. The suspect, later identified as William Owens, 39, of Sicklerville, New Jersey, was pronounced dead at the scene, the New Jersey Attorney General's Office said Monday afternoon.

UPS said in a statement all of its employees at the supply chain processing facility had been accounted for and were "being attended to" by local officials.

William Owens CBS Philadelphia

The man apparently had a prior relationship with one of the women taken hostage, Fiore said.

Get Breaking News Delivered to Your Inbox

Both of the women worked for UPS, Fiore said. No law enforcement officers were injured during the incident, he said.

The FBI and the federal Bureau of Alcohol, Tobacco, Firearms and Explosives responded to the scene, CBS News chief justice and homeland security correspondent Jeff Pegues reports. UPS had initially described the incident as an "active shooter situation."

The incident lasted more than three hours, CBS Philadelphia reports, with hostage negotiators talking to the gunman over the phone. Owens, armed with a handgun, emerged with the hostages shortly before noon. Multiple officers shot and killed him, the attorney general's office said.

"Through the intervention of the Gloucester County Prosecutor's Office and other law enforcement, they were able to apprehend the suspect. Apparently he was shot," said Fiore.

CBS Philadelphia said 32 employees were inside the facility when the incident occurred.

"Everyone was screaming, everyone was shocked with what's going on," one witness said. "People were falling on the floor."

Other major companies, including Amazon and U.S. Foods, have operations in the area, according to The Associated Press. Mayor Frank Minor said Logan Township has some 6,500 residents, with about 18,000 people in the area each workday.