Pakistan 's military says one soldier and seven militants were killed during a gun battle in the northwestern Swat Valley .