BUTTE, Mont. — Prosecutors in Montana said Wednesday they have dropped a driving under the influence charge against a former Navy SEAL who said he shot and killed Osama bin Laden.

Both sides in the case agreed that medication prescribed to treat symptoms related to Rob O'Neill's military service formed the basis for the DUI charge, The Montana Standard reported.

Butte-Silver Bow County prosecutors instead charged O'Neill with negligent endangerment and deferred prosecution for up to a year while he undergoes treatment through the Department of Veterans Affairs.

If O'Neill successfully follows the terms of the agreement, the endangerment charge will be dropped.

O'Neill was found asleep behind the wheel of a running car at a Butte convenience store at 2:30 a.m. on April 8. He has said he took a prescription sleep aid to treat severe insomnia.

"I am pleased that the charge has been dropped and the case dismissed without prejudice," O'Neill said in a statement released through CRC Public Relations. "I look forward to putting this matter behind me."

Sheriff Ed Lester said he believes it was a reasonable resolution of the case.

Deputy County Attorney Anne Shea said both sides agreed there was probable cause to charge O'Neill, but her office didn't have faith it could win a conviction at a jury trial. She did not say why.

In 2014, O'Neill said, he was the SEAL who shot bin Laden in a May 2, 2011, raid on a compound in Pakistan.