A man accused of shooting at Navy SEALs with a pellet gun during a training exercise pleaded guilty Wednesday, a day before his trial was set to begin.

Scott Weaver, 48, faces a year in San Diego County jail when he is sentenced Nov. 1. Weaver pleaded guilty to brandishing a replica firearm and attempting to threaten a witness to the July 23 attack, the San Diego Union-Tribune reported.

An assault with a deadly weapon charge was dismissed at an earlier hearing.

Authorities said Weaver confronted Navy SEAL instructors and trainees at around 10:30 p.m. during a nighttime qualification course over a small bay inlet and opened fire at them using a pellet gun.

San Diego police were called and he was arrested.

No military personnel were injured, FOX 5 San Diego reported. Police did not say whether Weaver had a motive for firing at the SEALs or if he was aware of who he was shooting at.

Weaver’s trial was scheduled to begin Thursday in San Diego Superior Court before his guilty plea. Prosecutors declined to release details about the threats made by Weaver that night.

Following the incident, a Navy spokesman said the SEALs train in the San Diego Bay, but would not confirm what they were doing that night.

Officials with the Naval Special Warfare Command said it would evaluate the training procedures with an eye toward safety of the divers as a result of the shooting.