Police respond to a carjacking Wednesday that took place in Southwest Washington that led to a short police chase, ending in Southeast with a gunman fatally shot by police and officer grazed by a bullet. (Marvin Joseph/The Washington Post)

D.C. police shot and killed a carjacking suspect Wednesday during a gun battle in Southeast Washington, less than an hour after a separate round of police gunfire in Northeast, authorities said.

The confrontations in neighboring police districts were unrelated, police said, and occurred about 45 minutes and eight miles apart. But two shootings involving police officers in such a short time is not typical.

“First time it’s happened since I’ve been chief,” said Police Chief Cathy L. Lanier, who has run the department since 2007. Lanier was at the scene of the first shooting in Northeast when the call went out about the second incident.

The second shootout occurred about 2:15 p.m. in the 800 block of Barnaby Street SE after a car was stolen at gunpoint from a woman in Southwest, police said. The victim flagged down a passing officer who broadcast a description of the stolen vehicle, a black Pontiac sports car.

Lanier said officers saw the car and chased it briefly. She said the car’s driver stopped on Barnaby outside the Gregory Apartments, a white, four-story building in the Washington Highlands neighborhood, near the Maryland line.

Lanier said the driver “exited the vehicle and turned toward a police officer.” She said the man “pulled a weapon and the officer engaged.” Police said that at least three officers were on the scene but that it was unclear how many fired at the man, who was fatally wounded. He was identified as Nathaniel McRae, 34, of Northwest Washington, police spokesman Hugh Carew said in a prepared statement late Wednesday.

Officials initially said the officer suffered a graze wound to his head in the shootout, but Lanier said police were investigating whether the officer was struck by a bullet or injured in another way. The chief said the officer was alert and talking as he was placed in an ambulance and taken to a hospital.

The wounded gunman collapsed on a stairway leading from Barnaby Street to the apartment building. He was taken to a hospital, where he was pronounced dead. His name and age were not immediately released. Police said officers recovered one gun at the scene.

A D.C. fire department spokesman said the ambulance carrying the wounded man to Howard University Hospital stopped near Route 295 and Pennsylvania Avenue when a warning light came on indicating that the engine was about to shut down. Tim Wilson, the spokesman, said that problem can occur in late-model vehicles driven continuously for extended periods.

Wilson said the patient was transferred to another ambulance five to seven minutes later and taken to the hospital, in Northwest Washington, about eight miles from the shooting scene. Lon Walls, the fire department’s chief spokesman, said the delay “did not affect care in any way.”

Several people who live nearby said they heard 10 to 12 gunshots but did not see the shooting.

A 43-year-old woman who lives in the Gregory Apartments said she was driving home from shopping and was turning off Atlantic Street, onto Barnaby, when she heard sirens behind her.

“I turned down my radio and saw police flying at me,” she said. The woman, who said she was too frightened to give her name, said she pulled over just as officers sped by. She said she did not see the Pontiac until she looked up and saw it stopped in the street about half a block away.

“I saw the car doors open and heard bam, bam, bam,” the woman said. She said she heard at least a dozen shots and saw the wounded man on the steps.

Because of the timing, parents walking children home from the Ferebee-Hope Elementary School, had to navigate around police crime-scene tape.

In the earlier shooting, an off-duty officer on his way to work about 1:30 p.m. spotted an armed robbery occurring at 34th and Baker streets NE, in the River Terrace neighborhood off Benning Road, Lanier said. Lanier said the officer was in uniform but was driving his personal car.

The chief said that gunfire was exchanged but that nobody was hit. Police had said earlier that a bullet struck the officer’s car. No arrest was made.

Statistics on the number of police-involved shootings this year in the District were not available Wednesday. The incident in Southeast was at least the second fatal shooting by a police officer in 2013.

Clarence Williams contributed to this report.