A teenager with a bullet lodged in his forehead that police wanted removed to prove he tried to kill the owner of a used-car lot has withdrawn a guilty plea and will face trial on several felony charges.

Joshua Adam Bush, 19, pleaded guilty last month to charges of deadly conduct and aggravated assault of a witness so that four other felony charges would be dropped. The charges stemmed from a July 2006 robbery at a used-car lot in Port Arthur, Texas.

But on Friday, Bush exploited a court error to reject the deal, which could have put him in prison for up to 10 years.

State District Judge John Stevens let Bush withdraw the guilty pleas because he was not properly informed of the maximum punishment he faced. A trial was scheduled for Aug. 11.

Police said Bush was part of a gang that broke into the car lot and tried to steal vehicles. Police said Bush tried to shoot the manager, a witness to the robbery, but the man fired back, lodging a slug in the fatty tissue of Bush's forehead.

Bush claimed he was accidentally shot by a friend.

Police and Jefferson County prosecutors wanted doctors to extract the bullet from Bush's forehead. But Bush and his attorney fought the removal because they said it would violate his civil rights.