The boy was taken to hospital to be treated for "potentially life-threatening" gunshot injuries, police said in a statement.