COEUR D'ALENE, Idaho (AP) - The man who had been wanted in Idaho for shooting a pastor when he was arrested for throwing items over the White House fence has accepted a plea deal that could keep his prison sentence under 25 years.

The Coeur d'Alene Press reports 31-year-old former Marine Kyle A. Odom pleaded guilty on Monday to felony aggravated battery with a felony firearm enhancement. Odom is accused of shooting Remington one day after Remington delivered the invocation at a Ted Cruz campaign rally in Idaho.

Remington survived being shot six times. One of the bullets became lodged near his brain, while others hit him in the back, shoulder and pelvis.

Odom told the court he has been taking prescription medications to deal with mental issues, but could think clearly enough to enter a guilty plea to the felonies.

Kyle Odom appears in Kootenai County courtroom for the first time.