A man with a BB gun in his yard near J.X. Wilson School west of Santa Rosa briefly set police and school personnel on edge Monday morning when a passing driver mistook it for a real gun, authorities said.

Responding officers found the gun leaning against the Brittain Lane resident's house and were able to determine it was only a BB gun, police Sgt. John Snetsinger said.

But Snetsinger said it would have been easy to mistake it for the real thing.

"It looked like a hunting rifle," Snetsinger said. "It had a scope on it and everything."

The owner lives on the east side of Brittain Lane near the entrance to the elementary school, prompting the passerby to call police and alert them shortly before 10 a.m.

It turned out the owner had been shooting at gophers, Snetsinger said.

"We got there pretty quickly and made a determination pretty quickly," he said.

School staff was just announcing a lockdown when police gave them the all clear, school personnel said.