A man accused of trying to rob a Yakima convenience store while armed with a shotgun was sentenced Wednesday to more than 15 years in prison for being a felon in possession of a firearm — a double-barrel, sawed-off shotgun.

David Allen Vickers, who was sentenced as an armed career criminal, pleaded guilty to the firearms charge in U.S. District Court in Yakima.

The case stems from a robbery attempt in January 2012 at La Milpa, a minimart at the corner of Sixth Avenue and Nob Hill Bouevard.

Vickers was accused of trying to rob the store while armed with the gun.

Both police and the store clerk say the shotgun went off when the clerk tried to wrest the shotgun from the robber.

Officers said they caught Vickers on foot. Witnesses reported that a suspected getaway driver fled after seeing Vickers struggling with the clerk.

Vickers was also charged with robbery in Yakima County Superior Court, but that case was dismissed once the federal indictment was returned, according to court records.