The third-order structure resonance due to sextupole magnetic fields was compensated in the Japan Proton Accelerator Research Complex (J-PARC) main ring synchrotron (MR) using new beam optics. In the present optics, the third-order structure resonance νx − 2νy = −21 was so strong that the working point was limited. The new optics cancels the resonance by adjusting the phase advances in the arc sections. The resonance compensation was verified by aperture survey simulations and further demonstrated by three types of experiments. First, the transverse coupling measurements were performed. The coupling was observed only for the optics without the compensation. It was also verified with the tracking simulation. Second, the beam losses were measured using present and new optics. The measured beam losses were noticeably reduced at the tunes around the resonance using the new optics. The beam loss reduction was also verified with the space charge tracking simulation. Third, Fourier analyses of the transverse dipole oscillations were conducted for both optics. Fourier spectra derived from the resonances were observed, and their peaks were clearly suppressed with the new optics. It was also consistent with the results of the space charge simulations.