Naoto Otake, a police official on Ishigaki, said there were no immediate reports of damage or casualties on the island, which has a population of 40,000.
"Nothing fell during the quake. Electricity, water and gas are all working," Otake said. He said authorities warned residents to stay away from beaches via speakers on patrolling police cars. But the agency lifted the tsunami warning 50 minutes later.
Japan is one of the world's most earthquake-prone countries. The most recent major quake in Japan killed more than 6,400 people in the western port city of Kobe in January 1995.
Taiwan's Central Weather Bureau said the quake was felt there as well. There were no immediate reports of casualties or damage. Although the Japanese agency put the preliminary magnitude at 6.8, Taiwan's agency recorded it at 6.5.
The Taiwanese agency said the quake struck at 8:05 a.m. local time (0005 GMT) Monday 118 miles (188 kilometers) southeast of the east coast city of Hualien. That puts its epicenter about 260 kilometers (160 miles) east of the area devastated by Typhoon Morakot on Aug. 8-9.
Taiwan's president says the storm has claimed about 500 lives. Efforts are continuing to rescue thousands of people still stranded after floods and mudslides cut off roads.