ANAHEIM, Calif. — Stipe Miocic waited over a year to face Daniel Cormier again, and his plan for the rematch didn’t start to work until they were deep in the fourth round.

That’s when the patient, determined firefighter from Cleveland finally got his revenge — and suddenly reclaimed his UFC heavyweight title.

Miocic stopped Cormier with a barrage of punches in the fourth, taking back his championship belt with a comeback victory at UFC 241 on Saturday night.

Miocic (19-3) lost the first two rounds on every judge’s scorecard in his rematch with the 40-year-old Cormier (22-2). After making some progress in the third, Miocic steadily came forward through Cormier’s blows in the fourth and finally hurt the champion with a punch to the body.

Miocic then landed several powerhouse right hands to Cormier’s head, buckling his knees and eventually forcing referee Herb Dean to stop the fight with 51 seconds left in the fourth round. The 6-foot-5 behemoth leaped onto the wall of the cage and celebrated with fans still stunned by the fight’s sudden turn.

“I saw some weakness in that third round,” Miocic said. “And then in that fourth round, I caught him with that right hand. Thank God, because he’s tough.”

Nate Diaz also returned from a three-year hiatus with a dominant decision victory over Anthony Pettis at Honda Center, but he was upstaged by the remarkable redemption of Miocic.

Miocic reigned as the UFC’s heavyweight champion for 26 months, and he defended his belt a UFC-record three consecutive times before Cormier dethroned him in July 2018 with a first-round stoppage victory. Despite Cormier’s decisive victory, Miocic campaigned for a rematch and eventually received it when Cormier said he “deserved it.”

Cormier’s quick hands were the difference early in the rematch. The 5-foot-11 Cormier also picked up his much larger opponent and slammed him onto the canvas during the first round, showing off the elite athleticism lurking in his dad bod.

“He got hit with everything but the kitchen sink, and he managed to stay in the fight,” UFC President Dana White said of Miocic.

Miocic landed plenty of shots, but Cormier’s blows were more frequent and more impactful — although not much makes an impact on the hulking Miocic. The fight turned quickly and decisively when Miocic finally hurt Cormier, who couldn’t recover.

“I took the pressure off a little bit,” Cormier said. “I don’t know why. Maybe (I) tried to rest and recover for the fifth round, because he wasn’t going anywhere. I don’t know what the reasoning was, but it was a mistake.”

Cormier didn’t announce his retirement in the cage afterward, but the former two-belt champion planned to think seriously about quitting MMA after this fight, no matter its outcome. The former Olympic-level wrestler had always planned to get out of the sport before he turned 40, but Cormier pushed his deadline by five months after surgery prevented him from fighting last March.

“A lot of times you base decisions on emotion, and I don’t want to be that guy,” Cormier said. “I’m going to go back and talk to (my wife) Salina, talk to my coaches and figure out what’s next. … Losing any type of fight for me is terrible, but getting stopped is just insane. That’s twice I’ve been stopped. That’s not good. I’m smart enough to understand that.”

White won’t rush Cormier for a decision.

“I don’t want to see him leave,” White said. “I still think he’s one of the absolute best in the world. Stipe is just one of the best heavyweights ever.”

Right before Miocic’s win, the 34-year-old Diaz (20-11) cemented his wild popularity with an impressive performance in his first fight since he split a pair of bouts with Conor McGregor in 2016.

Diaz punished Pettis (22-9) in standup striking and on the ground, winning 30-27 on two judges’ scorecards and 29-28 on the third. Fighting through a serious cut near his eye, Diaz repeatedly hurt the former lightweight champion and nearly got a finish several times in the third.

“I wasn’t sure if there would be some rust or not, so I just treated it like there might be,” Diaz said. “I didn’t want to sit around and think about it. Just ignore it and go.”

Diaz’s popularity didn’t wane while he declined a series of matchups over the last three years. He sounds interested in fighting more frequently now, and he used his post-fight interview to call out Jorge Masvidal, another popular veteran brawler.

“You’ve got to recognize the best of the best in this game, and it’s not who they’re saying it is,” Diaz said. “It’s who I say it is. That’s the best fighter, to me. The best martial artist who’s still on top of the game. … I’ll be here in 40 years, still fighting, still killing.”

Unbeaten Brazilian middleweight Paulo Costa won a bruising decision over Cuba’s Yoel Romero in a long-anticipated fight that was also worth the wait. Three previous bookings of this matchup fell through due to injury, but the two cartoonishly muscled 185-pounders captivated the crowd with a spectacularly physical fight that Costa won 29-28 on all three scorecards.

Khama Worthy, a 32-year-old veteran making his UFC debut on short notice, pulled the upset of the night with a first-round knockout victory over touted prospect Devonte Smith on the undercard.