The Nigerian army on Sunday rescued students and staff who were abducted by gunmen from a school in the country's north, days before a deadline to pay a $690,000 ransom.