There were no immediate reports of damages or casualties. The agency issued a tsunami warning as a cautionary measure, but removed it within minutes.
The quake was centered in the northern part of Saitama Prefecture, a state northwest of Tokyo, and 50 kilometers (31 miles) below ground level, the agency said.
The quake shook all 23 wards of Tokyo, as well as the surrounding prefectures including Ibaraki, Tochigi, Saitama and Gunma.
AFP reporters in the Japanese capital said the strong quake shook buildings in Tokyo, setting off alarms and bringing the city’s subway system to halt.
Japan is one of the most earthquake-prone nations in the world. A magnitude 5 quake can cause considerable image, while a magnitude 6 temblor can cause severe damage. With a report from AFP
RELATED STORY
Quakes rock Batangas, Cagayan, Dinagat