The quake produced powerful shaking along parts of Japan's eastern coast, and was felt strongly in Tokyo, but triggered no tsunami alert.
The benchmark Nikkei 225 index fell 0.44 per cent, or 104.41 points, to 23,454.89 while the broader Topix index lost 0.62 per cent, or 10.26 points, to 1,640.84.
The benchmark Nikkei 225 index gained 0.65 per cent, or 152.81 points, at 23,559.30, while the broader Topix index was up 0.88 per cent, or 14.46 points, at 1,651.10.
The mystique of Japan's once-feared covert warriors, spread by films and fiction, is embodied today in the world's first winner of a master's degree in ninja studies.
The Nikkei 225, which snapped a six-day losing streak on Monday, added 378.28 points to close at 22,573.66, while the broader Topix index rallied 2.14 per cent, or 32.62 points, to 1,555.26.
The benchmark Nikkei 225 index slipped 0.26 per cent, or 58.81 points, to end at 22,514.85, while the broader Topix index inched down 0.04 per cent, or 0.55 points, to 1,554.71.
The benchmark Nikkei 225 index gave up 0.39 percent or 88.21 points to 22,329.94, but made a weekly gain of 2.86 percent, driven up by robust US shares.The broader Topix index lost 0.20 percent or 3.14 points to 1,546.74, but advanced 3.39 percent over the week.
The benchmark Nikkei 225 index rose 0.41 per cent, or 93.72 points, to 22,843.96, while the broader Topix index jumped 1.23 per cent, or 19.57 points, to 1,605.53.
The benchmark Nikkei 225 index soared 405.65 points or 1.78 per cent to 23,249.61, the best close since February 21, the broader Topix index rose 18.62 points or 1.16 per cent to 1,624.15.
The Nikkei 225 index edged up 0.17 per cent, or 39.75 points, to close at 23,289.36. Over the holiday-shortened week, it gained 4.3 per cent. The broader Topix index inched down 0.05 per cent, or 0.77 points, to 1,623.38, but was up 5.0 per cent from a week earlier.