A suspect is in custody after a police officer was shot in Dorchester Friday morning.

The shooting happened on Mount Bowdoin Terrace around 10:30 a.m., according to local media. 

The gunman, identified as Grant Headley, 27, a suspected drug dealer from Dorchester, was apprehended following a brief pursuit, according to the Boston Globe. 

“He is out on probation and he is out selling drugs, and that’s why he was pulled over,’’ Boston Police Commissioner William B. Evans said at a news conference Friday, according to the Globe.

RELATED: Two Dorchester men busted on drug trafficking charges

The Globe said that Evans described the shooting as  “unprovoked,’’ when, as officers tried to arrest him, Headley jumped out of his car and fired his weapon. The officer who was injured then shot back.

Headley was captured during a footchase by cops. No other shots were fired.

The injured officer, who was hit in the leg, was taken to Boston Medical Center. WCVB reports the nine-year veteran and member of the Mattapan Drug Control Unit is expected to be fine

A 40 mm handgun was recovered, Evans said.