The military says 17 rebels and at least six security personnel were killed in the fighting , which came as opponents of King Gyanendra 's direct rule continued to defy a government crackdown .