LAS VEGAS — The UFC has completely shuffled the top three fights on its UFC 279 card one day before the scheduled pay-per-view event, UFC president Dana White told SportsCenter in a live Instagram video Friday.

Nate Diaz now will face Tony Ferguson in the main event of the Saturday show at T-Mobile Arena. Diaz’s original opponent, Khamzat Chimaev, missed weight by 7.5 pounds Friday morning, coming in at 178.5 pounds for a 171-pound-limit bout. Diaz understandably chose not to fight such an overweight opponent.

White said Chimaev started cramping and locking up during his weight cut.

“It’s not by coincidence that we stack guys in the same weight on the same card in case something goes wrong. It worked out,” White said. “Getting these guys to agree to different fights can be a little tough sometimes. We got it all done. We’re locked in.”

Chimaev’s weight miss caused a chain reaction. The UFC spent the entire morning and afternoon negotiating with all six camps for these changes. Alterations at this level so close to a UFC card are unprecedented.

Ferguson, a fan favorite like Diaz, had been scheduled to fight Li Jingliang in the co-main event Saturday. Ferguson weighed in at 170.5 pounds for that fight.

Diaz vs. Ferguson will be five rounds. Diaz had been scheduled for five rounds with Chimaev, but Ferguson vs. Li was only going to be three. Ferguson agreed to fight for five rounds against Diaz.

“Nate Diaz and Tony, the fans have wanted to see this one forever,” White said. “It’s going to happen now before Nate leaves the UFC. It couldn’t have played out any better.”

Now, Chimaev will take on Kevin Holland in the UFC 279 co-headliner. Holland’s original opponent was set to be Daniel Rodriguez in a 180-pound catchweight bout. Holland weighed in Friday morning at 179.5 pounds. Holland-Chimaev will also be a five-round bout.

Li, who weighed 170.5 pounds Friday, will now fight Rodriguez. There will be a large weight gap, as Rodriguez came in at 179 pounds.

Chimaev, 28, is one of the UFC’s biggest rising stars and was a -1000 favorite over Diaz, per Caesars Sportsbook. The UFC essentially booked this fight to get Chimaev a bout with a big star in Diaz in which he was expected to win. Diaz is on the final fight of his UFC contract and has indicated this will be his last bout with the promotion, at least for now.

Chimaev has had a bizarre week. He got into a verbal altercation with middleweight Paulo Costa on Wednesday at the UFC Performance Institute, and Thursday before the UFC 279 news conference, he got into a skirmish with Holland, whom he will now fight. Chimaev kicked Holland during the backstage encounter. The news conference was ultimately canceled.

When Chimaev weighed in Friday morning, he shrugged his shoulders and showed no contrition for the massive miss. Later, he posted a meme on Twitter joking about missing weight.