The quake was at a depth of 6.2 miles (10 km) about 68 miles (110 km) southeast of Misha, Nicobar Islands, in the Indian Ocean, the agency said.
An official at the provincial disaster management control room said there were no immediate reports of casualties or damage but the earthquake had been felt by islanders.
The official said there was no tsunami alert.
Andaman and Nicobar is made up of more than 500 mostly uninhabited islands. A Reuters witness at Port Blair, the capital, said the earthquake was not felt there.