Authorities say students abducted by gunmen from a school in northern Nigeria have been released unharmed.