PINOLE -- A 20-year-old Pinole man target-shooting with an air rifle in his backyard caused a scare at a nearby middle school Thursday, forcing a lockdown but ultimately not breaking any laws, police said.

Police did not identify the man, who created the stir by holding the air rifle and pointing it at targets near a hillside to the west of the Pinole Middle School gymnasium just before 12:30 p.m., Pinole police Sgt. Matt Avery said.

The man wore a dark beanie, a black, hooded sweatshirt and dark-colored, cargo-type shorts, Avery said. He was spotted by a teacher and an unknown number of students.

Witnesses told police the gun appeared to be a rifle in a soft case slung over the man's shoulder. A Pinole police resource officer assigned to the campus evacuated students and staff from the gymnasium and campus, after which the school was locked down for a few hours.

Pinole and Hercules police using police dogs closed off the area and found a man matching the description in the backyard of a home on Boyle Court. An Air Soft rifle and a BB gun were found at the house, but police determined the man never went on school property and never left his backyard.

Therefore, Avery said, no charges could be filed.

"The way the statutes are written at the state and the local level, we could only conclude that no charges will be filed," Avery said. "But people should realize that if they decide to do something similar, it's likely that the police are going to be called."

Parents received notification from the West Contra Costa Unified School District on Thursday afternoon.

The lockdown was lifted after the man was taken into police custody, Avery said.

"It was not the smartest thing to do," Avery said. "Given the climate of the times, I would not recommend it."

Rick Hurd covers breaking news. Contact him at 510-262-2728 and follow him at Twitter.com/3rdERH.