A white North Carolina man was arrested alive despite pointing a shotgun at passing cars and then firing a handgun at a sheriff’s deputy who tried to arrest him.

The arrest comes the same week two black men were shot and killed by police while legally carrying — but not holding — firearms.

Investigators said 62-year-old William Bruce Ray was standing near a road Tuesday in Wake County when a passing deputy spotted him pointing the shotgun at passing motorists, reported WRAL-TV.

ADVERTISEMENT

Related: Here are 8 white people who pointed guns at police officers — and didn’t get killed

Deputy D.R. Farmer stopped to question Ray, who became belligerent and pointed the shotgun at him.

Farmer grabbed the barrel and pushed back Ray, who then said, “I got something for you,” and reached into his pocket for a .22-caliber pistol — which the deputy knocked away.

The handgun fired as Farmer pushed it away, but the bullet did not strike anyone.

“As a deputy, you don’t ever know what to expect when you’re approaching something like that, so your training kicks in,” said Sheriff Donnie Henderson. “When the gun came up, it was automatic to (Farmer) to get that gun away from (Ray), and he did exactly what he was supposed to.”

ADVERTISEMENT

The deputy then arrested Ray, who deputies said appeared to have been heavily intoxicated.

“Luckily, nobody got hurt, that’s the good thing,” Henderson said. “God was looking out for us. (Ray) was very fortunate that he didn’t get shot, very fortunate that anybody didn’t get shot.”

Ray was charged with assaulting a law enforcement officer with a firearm and damage to personal property, and authorities said he would likely be charged with attempted murder.

ADVERTISEMENT

It’s not clear whether he legally owned or carried the weapons used in the incident.

Authorities said they’re trying to determine why Ray was so angry, but his attorney — who also lives next door — said the man suffers from mental illness, including bipolar disorder and depression.

ADVERTISEMENT

He remains jailed on $150,000 bond.

Watch this video report posted online by WRAL-TV: