The intense shaking prompted a brief tsunami alert for the entire Indian Ocean and Bay of Bengal, but there were no reports of any significant changes in sea level.
The 7.5 magnitude quake was also felt hundreds of miles away on the Indian mainland when it struck at 1:26 a.m. local time.
Near the epicenter, people rushed outside in panic as the ground shook violently for about 20 seconds.
The Nicobar and Andaman Islands were struck hard by the December 2004 earthquake and tsunami, leaving a lingering fear of such disasters each time a strong quake strikes.
The earlier disaster killed more than 220,000 people, mainly in the far western Indonesian province of Aceh, at the northern tip of Sumatra Island.
Thousands of other victims perished in Thailand, India, Myanmar and Sri Lanka.