NEW BERN (AP) — A North Carolina man has been sentenced to 21 years in prison in connection with a crime rampage that including a police officer being shot, prosecutors said.

Cedric Jamal Kearney, 26, of Henderson pleaded guilty to the charges in March and was sentenced on Thursday, said G. Norman Acker, III, Acting U.S. Attorney for the Eastern District of North Carolina, in a news release.

Court documents and information presented in court say Kearney and a co-defendant robbed a Raleigh man of his car keys and cellphone at gunpoint in January 2019. The run of crimes continued as Kearney and other co-defendants broke into a Holly Springs apartment and stole several firearms and pairs of shoes, according to the news release.

Raleigh police officers responded to a reported sighting of a stolen vehicle, and when they arrived, they witnessed Kearney and another man trying to get inside the stolen vehicle, court records show. Kearney fired shots at the officers and hit one before fleeing on foot. The officer suffered life threatening injuries, but survived.

Kearney was found several hours later in a homeowner's shed.

Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.