Plain clothes officers patrolling in the town spotted the teenager and detained him.
The child, who cannot be named because of his age, confessed to having a large machete.
A further search found a second knife and 78 wraps of class A drugs in his underwear.