We perform 3D quasi-dynamic modeling of the cycle of a megathrust earthquake in the offshore Tohoku region, Japan, using a rate- and state-dependent friction law with two state variables that exhibits strong velocity weakening at high slip velocities. We set several asperities where velocity weakening occurs at low to intermediate slip velocities. Outside of the asperities, velocity strengthening occurs at low to intermediate slip velocities. At high slip velocities, strong velocity weakening with large displacements occurs both within and outside of the asperities. The rupture of asperities occurs at intervals of several tens of years, whereas megathrust events occur at much longer intervals (several hundred years). Megathrust slips occur even in regions where velocity strengthening occurs at low to intermediate slip velocities, but where velocity weakening is dominant at high slip velocities. The proposed model explains that megathrust earthquakes occur in the same subduction zone as large thrust earthquakes.