The week leading up to UFC 223 featured a chain of events unprecedented even by mixed martial arts’ often-chaotic standards.

How did a 13-fight card headlined by Tony Ferguson vs. Khabib Nurmagomedov end up a nine-fight show headlined by Nurmagomedov vs. Al Iaquinta, with superstar Conor McGregor finding himself in police custody? Here’s a timeline of an incredible turn of events leading up to Saturday night’s card at Brooklyn’s Barclays Center:

Thursday, March 29

During a Los Angeles media tour, interim lightweight champion Tony Ferguson suffers a freak knee injury by tripping over a heavy production cable on the FOX lot. Not realizing the extent of the injury, Ferguson attempts to continue training over the next couple days.

Saturday, March 31

Ferguson visits his doctor and gets an MRI which shows a torn lateral collateral ligament.

Sunday, April 1

Ferguson informs the UFC of his injury and formally withdraws from the bout. The UFC announces that featherweight champion Max Holloway will fight Nurmagomedov for the official championship, meaning both that McGregor is stripped of his version of the title, which he won in Nov. 2016 and did not defend, and that Ferguson’s version of the belt will be discarded.

Monday, April 2

Top featherweight contender Brian Ortega confirms that he was offered and accepted the bout with Nurmagomedov, but had the offer withdrawn when Holloway took the bout.

Tuesday, April 3

Nutritionist George Lockhart, who worked with both Holloway and Nurmagomedov, tells MMA Fighting that Holloway is ”tied for the largest weight that I’ve ever done.” Nurmagomedov soon thereafter severs ties with Lockhart.

Nurmagomedov gets into a hotel lobby confrontation with Conor McGregor’s SBG teammate, Artem Lobov, who was scheduled to fight Alex Caceres in a featherweight bout on Saturday night.

Wednesday, April 4

Nurmagomedov, Holloway, and co-main eventers Rose Namajunas and Joanna Jedrzejczyk participate in a spirited press conference in Brooklyn.

Thursday, April 5

Main card fighters appear at the UFC 223 media day at Brooklyn’s Barclays Center.

After the event, McGregor and an entourage estimated around 20 people break into the Barclays loading dock, looking for Nurmagomedov. The Russian fighter, along with manager Ali Abdel-Aziz and a cornerman, are on a shuttle bus of red-card fighters which was about to leave the hotel. McGregor first throws a guardrail, then a grabs a dolly and shatters a window in the van. Several are injured in the incident, including lightweight Michael Chiesa, who suffers facial lacerations, and an unidentified UFC employee who suffers a broken knuckle.

UFC president Dana White declares the incident “the most disgusting” in UFC history, and immediately pulls Lobov, who was allegedly part of the incident, from the card, leaving Caceres without an opponent.

Chiesa is treated at the hospital, returns to the hotel with the intention of fighting, and resumes his weight cut, but his bout with Anthony Pettis is ultimately removed from the card.

Late afternoon, flyweight Ray Borg, who was also in the van, goes to the hospital, complaining about an inability to close his eyes, which he believes is due to shards of glass during the incident. Borg’s bout with Brandon Moreno is subsequently scratched from the card, bringing the card to 10 bouts.

McGregor turns himself in at the New York Police Department’s 78th precinct in Brooklyn at 10:23 p.m. ET and is formally arrested and held overnight.

Friday, April 6

McGregor is formally charged with three counts of misdemeanor assault and one count of criminal mischief. McGregor’s SBG teammate, Cian Cowley, is charged with one count of misdemeanor assault and one count of criminal mischief.

At the official morning weigh-ins in Brooklyn, the New York State Athletic Commission pulls Holloway from the bout with Nurmagomedov, declaring him unfit to continue cutting weight, despite Holloway’s vigorous protestations.

Nurmagomedov weighs in at 154.5 early in the two-hour window.

The UFC attempts to make a five-round title fight between Nurmagomedov and Pettis. Pettis weighs-in at 155.2 pounds, .2 above the allowable limit for a title fight. NYSAC had set precedent for allowing championship fighters an extra two hours for a second weigh-in last year, when Daniel Cormier needed an extra attempt to make weight for his UFC light heavyweight title defense against Anthony Johnson in Buffalo, but the scale is removed and Pettis does not return for a second weigh-in attempt.

The UFC then attempts to make a Nurmagomedov bout with Paul Felder, who successfully weighed in for his bout with Al Iaquinta, but the NYSAC doesn’t allow it.

At about 4 p.m. ET, roughly three hours after the initial weigh-ins window concluded, Nurmagomedov vs. Iaquinta is named as the new UFC 223 main event. If Nurmagomedov wins the scheduled five-round fight, he becomes UFC lightweight champion. If Iaquinta wins, he doesn’t, because he weighed in at 155.2 pounds, above championship weight — even though when he was weighing in, he only needed to hit 156 for a scheduled bout with Felder.

Felder and Pettis, who are both lightweights, end up without opponents. As training partners in Milwaukee, they’re not going to fight one another. UFC 223 ends up with nine fights.

McGregor faces a judge in Kings County Criminal Court in Brooklyn to answer to his charges. McGregor is freed on $50,000 bail and ordered to reappear on June 14. He is free to return to Ireland. McGregor is ordered to have no contact with Chiesa, Borg, and two others. Cowley is freed on $25,000 bail and also ordered to return on June 14.