A man was sentenced by a judge to five years in federal prison Wednesday after he carjacked a pregnant woman in labor last year in Annapolis, Md.

Devery Hasani-Jarod Kelley, 25, from Glen Burnie, pleaded guilty to pointing guns at a man and a woman getting into a car in March 2014, ABC News reported. Cornell Robinson, 44, who committed the crime with Kelly, was convicted last month.

The story allegedly began at 4:30 a.m. on March 2, 2014, when the two men approached the couple as they were getting into their car. The male victim managed to escape and call for police, but they caught the woman and forced her into a nearby residential building, demanding money, witnesses testified, according to the Canada Journal.

The woman allegedly told them that she was pregnant, in labor and didn't have the key to the residence. When it became clear that the woman couldn't enter the apartment, Robinson took her car key and left in her car.

Upon being alerted to the crime, officers from the Annapolis Police Department pursued the stolen vehicle into Eastport. In an attempt to cover up part of the crime, Kelley threw out a loaded handgun at the corner of Tyler Avenue and Hilltop Lane, which was later recovered by police, according to the Capital Gazette.

The pair soon got out of the car on Tyler Avenue but were quickly caught and arrested. Police also recovered a shotgun from a neighbor's yard.

Robinson was convicted on July 29, and his sentencing is set for November.