The measure of a true champion is how he responds when adversity hits him square in the face. That’s exactly what happened to Anthony Joshua.

Joshua beat Andy Ruiz Jr. in their much-anticipated rematch Saturday with a unanimous decision in the 12-round heavyweight bout in Saudi Arabia.

Joshua won back his heavyweight championship from Ruiz with the judges scoring the fight 119-109, 118-110 and 118-110.

Ruiz knocked Joshua down four times in his shocking victory on June 1 at Madison Square Garden. But Joshua controlled the rematch as Ruiz looked heavier and less effective against the fitter boxer.

Joshua, from Watford, England, exhibited keen boxing skills and, unlike the first fight, resisted brawling with Ruiz.

“I just wanted to put on a great boxing masterclass and also show the sweet science of this lovely sport is about hitting and not getting hit,’’ Joshua said.

Ruiz, who had become the first Mexican heavyweight boxing champion with his victory over Joshua this summer, couldn’t land the knockout punch he needed this time. Ruiz ended their Madison Square Garden fight with a TKO in the seventh round. On Saturday, Joshua out-boxed him.

“It was his night, man,’’ Ruiz said. “I think I didn’t prepare how I should have. I gained too much weight. But I don’t want to give any excuses. He won. He boxed me around.’’

It was a classic case of Ruiz letting the newfound fame get to his head and his weight. Ruiz came into the rematch 18 pounds heavier from the first fight.

Both men stated they wouldn’t mind a third fight and that may be best for the sport. Tyson Fury and Deontay Wilder seem to destine for a trilogy of their own.