A New York City police officer on Thursday morning shot and wounded an armed man who led the police on an erratic chase through the quiet streets of Midwood, Brooklyn, after robbing a cellphone store, the authorities said.

The police said investigators recovered a 9-millimeter handgun from the ground, and a second firearm from a bag, near the Jeep sport-utility vehicle that the man and two others crashed into a parked car before trying to run away. The man was in stable condition at Kings County Hospital Center with two gunshot wounds to his torso.

The chase, shooting and eventual arrest of the wounded man and another suspect threw the neighborhood into chaos and startled residents who said they were unaccustomed to violent crime in the area.

Two men brandishing a firearm entered an authorized Verizon retailer at the corner of Avenue P and East Second Street around 11 a.m., Assistant Chief Patrick Conry, who is the Brooklyn chief of detectives, said. The men ordered the four workers who were inside into a back room and ran off with a number of cellphones.

One worker called 911 and gave the police a description of the men while a store manager got into his car and followed them as they fled in their Jeep. The manager flagged down a marked patrol car and told officers about the robbery, prompting them to broadcast a description of the vehicle and the suspects to other officers, the police said.

About a dozen blocks away, near the corner of East 14th Street and Avenue O, a uniformed sergeant and another officer spotted the Jeep.

“When they approached the vehicle, it crashed at the corner,” Chief Conry told reporters, speaking near the Jeep, which was wedged between a police car and a parked car, its doors flung wide open.

Three men hopped out of the car, one of them carrying a gun, before that man was shot several times by an officer. Chief Conry said it was not clear whether the man had pointed his gun at the officers, who were not injured.

Another suspect was taken into custody, and the police were searching for a third suspect on Thursday evening. They said he was wearing a gray hooded sweatshirt. The names of the two suspects in custody were not immediately released.

The police were also investigating whether the robbery was tied to other holdups of cellphone stores in the area.

“We’re certainly looking into this to see if we can make the connection to any other similar robberies, as we always do,” Chief Conry said.

A police spokesman said investigators had recovered a radio scanner from the Jeep, suggesting the men had made preparations for the robbery.

Residents nearby described hearing a crash, followed by about five to 10 gunshots.

“I thought a plow hit a car,” said a woman who lives across the street from where the Jeep sat. She said she looked outside to see a few men running. “Then I heard a crackle and turned to the right and saw at least two officers, might have been three, shooting, guns pointed downwards,” she said.

The woman, like other residents interviewed, declined to give her name to protect her privacy.

Another resident of the block said she was helping her children out of her car when the Jeep crashed, sending her running into her home with her children and then back out on her own to see what happened.

“My babies,” she said. “Of course it made me nervous. This is a safe neighborhood. It’s not supposed to happen like that.”

The woman said she saw one of the men drop a fancy handbag as he was running. The police later released a photo of one of the firearms resting on a Louis Vuitton bag.

As detectives combed the scene on Thursday afternoon, many young residents pressed up against the police tape, needling officers and journalists for some word on the shooting.

“Gunshots are not something you usually hear about here,” said Sammy Zarzar, who lives on the block where it happened. “The worst thing that happens on this block is bad traffic.”

A version of this article appears in print on , on Page A27 of the New York edition with the headline: Police Say Officer Shot Man Fleeing the Scene of a Robbery in Brooklyn. Order Reprints | Today’s Paper | Subscribe

Sign up for the New York Today Newsletter

Each morning, get the latest on New York businesses, arts, sports, dining, style and more.