A 911 caller reporting a man armed with a semi-automatic rifle on Wednesday afternoon in Oakdale had mistaken the weapon for a pellet gun, Suffolk County police said.

Police found him “just walking along” the train tracks, a spokeswoman said.

advertisement | advertise on newsday

“He didn’t menace anyone; he didn’t point it at anyone,” a police spokeswoman said.

The emergency call was received at about 2:25 p.m.