A young man armed with a gun was shot and killed Tuesday afternoon in a confrontation with officers in Southeast, D.C. police said.

Police said in a statement that a weapon was recovered after the 2:30 p.m. shooting in the 2400 block of Elvans Road. Two police sources said the weapon turned out to be a BB gun.

Police officials said the gun recovery unit had been sent to area because of problems there. While on patrol Tuesday, unit members encountered a male with a gun, the department said in a statement. The statement gave few details of how matters unfolded.

The suspect was pronounced dead at a hospital, the statement said. No name or age was given. But one police source and a neighborhood resident indicated that he was about 18.

Police sources said the gun unit officers saw the young man walking on Stanton Road near Elvans. Spotting a bulge in his waistband, they asked from their unmarked vehicle to talk to him. He began walking rapidly and then to run as the officers continued to try to get his attention, the sources said. He turned onto Elvans.

As police pursued, in the vehicle and on foot, the young man reached into his waistband and pulled out what appeared to be a gun, the sources said. They said an officer fired twice.

A neighborhood resident said the young man once lived there and still visited.

From what she saw of the chase, she said, “that boy did not have a gun.” But, she added, “he was holding the side of his pants” as he fled. “He was pulling his pants up and holding them.”

The pursuing officers yelled things “like, ‘Stop running’ ” and “Catch him,” she said.

Police Chief Cathy L. Lanier said gunfire plagued the neighborhood, along with “a lot of PCP and everything else.”

“That’s what drives my deployment of these kinds of units,” Lanier said.

Since 2007, the unit has recovered 1,381 guns across the city, said its chief, Inspector Brian Bray. Of those, he said, 120 were BB guns or replica guns.

Staff writer Theola Labbe contributed to this report.