The school, which is located on Vancouver Island near Victoria, was locked down while police moved in and arrested a suspect.
The child was taken to hospital, but was not seriously injured and was treated and released.
The shooting occurred as two boys were in the playground playing with two dogs, said Pat Duncan, associate superintendent of schools for Greater Victoria.
"What we believe might have been the dog owner came out of his house and one of the boys all of a sudden felt a very sharp sting on his lower left backside," Duncan told CBC News.
"He looked back and saw a gentleman heading back into the house with the dogs and what appeared to be a pellet gun in his hand."
The school lockdown has since been lifted.