A sheriff's deputy who fatally shot a man he thought was trying to take his gun was justified in using deadly force because he believed he was at risk of serious injury or death, according to a Maine attorney general's office investigation made public Friday.

York County Sheriff’s Office Deputy Levi Johnson shot Tyler Woodburn on Sept. 7 during a struggle outside a Waterboro home, according to the results of an investigation by the office of Attorney General Aaron Frey, which under state law investigates all deadly shootings involving law enforcement.

MAINE AG RULES OFFICER JUSTIFIED IN SHOOTING DESPITE 37-FOOT DISTANCE

Johnson had gone to the home in response to a 911 call reporting that Woodburn was driving while drunk with his girlfriend in the vehicle and may be armed.

Portland, Cumberland, Augusta crime

The Maine attorney general's office ruled that a York County sheriff's deputy was justified in the fatal shooting of a man who tried to take his service weapon during a physical struggle.

A resident of the home asked that Woodburn be removed, and as the deputy escorted Woodburn outside, a struggle ensued, according to the investigation.

The deputy tried several times to use an electronic stunning weapon to no avail, according to the report. Woodburn tried to take the stun gun and, when the two fell to the ground, also tried to take the deputy's gun, which was still in its holster, according to the report.

MAINE AG SAYS DEPUTY WAS LEGALLY JUSTIFIED IN FATAL SHOOTING OF ARMED 16-YEAR-OLD

Johnson got up and told Woodburn to stop, but he again tried to take the weapons, and the deputy fired two shots, officials said. Woodburn was hit twice in the chest and died at the scene.

Several eyewitness accounts were consistent with Johnson's version of events, the report said.

CLICK HERE TO GET THE FOX NEWS APP

Woodburn lived at the home with his girlfriend, their 1-year-old daughter, and her parents, the Portland Press Herald reported. A message was left at the home Friday.