Joshua, who suffered a stunning knockout defeat to Ruiz in New York in June, produced a masterclass to regain his IBF, WBA and WBO titles in emphatic fashion.
Dominating from the outset, Joshua won by margins of 118-110 on two scorecards with the third judge making it 119-109.
Billed as the “Clash on the Dunes”, the eagerly anticipated rematch marked the first time a world heavyweight title fight has been staged in Saudi Arabia.
And after entering the purpose built open-air arena at Diriyah, on the outskirts of the Saudi capital, just after midnight, it was Joshua who rose to the occasion with a stylish victory.
The final scores in no way flattered Joshua, who frustrated his heavier opponent with superb movement while picking off Ruiz relentlessly with his jab.
Joshua, badly stung by his defeat to Ruiz at Madison Square Garden, was ecstatic after clinching a one-sided win.
“The first time was so nice, I had to do it twice,” Joshua said as he celebrated becoming a two-time world heavyweight champion.
The 2012 Olympic champion revealed he had adapted his style after June’s loss to Ruiz, when he got drawn into a slugfest before being floored four times on his way to the first loss of his career.
“I’m used to knocking guys out and last time, I realised that I hurt the man but I got caught coming in,” said Joshua, who improved to 23-1, 21 by knockout.
“No excuses, but I said to myself I’m going to correct it and come again.”
“I just wanted to put on a great boxing masterclass tonight and also show the sweet science of this lovely sport,” Joshua added. “t’s about hitting and not getting hit.”
Ruiz had shocked onlookers at Friday’s weigh-in by tipping the scales at 283 pounds (128.4 kilograms), fully 15 pounds heavier than his weight in the first fight.
Joshua by contrast came in at 237 pounds, his leaner, less bulky physique allowing him to dance around the ring for 12 rounds to leave Ruiz pawing at shadows.
Ruiz admitted he had prepared poorly for the rematch.
“It was his night man,” Ruiz said. “I didn’t prepare as I should of. I gained too much weight. But I don’t want to make excuses, he won, he bossed me around.
“But if we do a third fight you best believe I’m going to get in the best shape of my life.”
Pressed on his excess weight, Ruiz said it had “affected me a lot.”
“I thought I was going to feel stronger and feel better, but on my next fight I’m going to get better prepared.”