Officers were called to reports of a someone walking along Hazel Road carrying what appeared to be a firearm at 11.30am on Sunday.
A 12-year-old boy was stopped and found to be in possession of a BB gun.
A spokesman for Pontefract and Knottingley Neighbourhood Policing Team said: “The weapon was seized from the child and will be destroyed.
“We visited his home address where the boy’s parent was spoken with and advised in regards to the seriousness of their child’s actions.”
The spokesman added: “May we take this opportunity to remind you all of the serious implications of the possession of these style of imitation guns.
“They can cause alarm and distress to members of the public as it is easy to mistake them for real firearms.
“In the past our firearms officers have been deployed to similar reports. This could result in an arrest being made or proactive action being taken from our Fire Arms unit.”