LAS VEGAS -- With less than two weeks to prepare, Nate Diaz pulled off one of the most shocking upsets in UFC history Saturday night as he rallied and forced Conor McGregor to tap out with a second-round rear naked choke to cap an incredible night at UFC 196.

Diaz had to endure some early punishment from McGregor, but he showed off his always durable chin and unbeatable spirit to pull off the stunner in front of a raucous crowd at the MGM Grand Garden Arena.

It was the second upset of the night, following Miesha Tate's fifth-round submission victory over Holly Holm, who beat Ronda Rousey for the women's bantamweight title.

More from FoxSports

The trouble for McGregor started early in the first round when he quickly realized what it felt like to deal with a longer, taller fighter like Diaz. Throughout his UFC career, McGregor had been a much bigger fighter than all of his featherweight opponents, but Diaz had him by a couple of inches in height and reach and it showed.

McGregor still managed to land the better shots throughout the opening round, including a couple of hard left hands that opened a cut over Diaz's right eye.

A final exchange toward the end of the round put McGregor on the ground inside Diaz's guard, but the Irishman showed no fear as he continued his offensive assault until the horn sounded.

As the second round started, McGregor looked confident but also seemed somewhat flat-footed as he stalked Diaz across the Octagon while throwing hard punches from distance.

A few of McGregor's shots found a home as Diaz's face started to show the wear and tear of the punishment he was taking, but the UFC veteran refused to back down and it paid off.

Diaz kept the pressure on as he moved forward, throwing punches in bunches and eventually his shots started to land. One of Diaz's combinations not only found a home, but a hard right hand rattled McGregor and his legs wobbled underneath him.

The crowd rose to its feet with a deafening sound as McGregor looked hurt for the first time in his UFC career, and Diaz recognized that this was his opportunity.

Diaz continued to pour on the offense until he put McGregor on the mat and immediately moved into the mount while raining hard punches.

McGregor rolled and Diaz seized the opening to take the featherweight champion's back and quickly slip his arm under the chin to lock up the rear naked choke.

With McGregor completely flattened out on the mat, Diaz gave him no chance to escape as he sunk the choke even deeper and a second later the Irishman was tapping the forearm to signify the fight was officially over.

It was a shocking finish considering Diaz took the fight on less than two weeks' notice, and he put on an incredible performance as McGregor's 15-fight winning streak came to a devastating end. The finish came at 4:12 in the second round.

"I'm not surprised, (expletive)," Diaz shouted after having his hand raised in victory. "I'm always in good shape; I peak as I go. I thought I landed with some good punches that got him off. I started off slow but I'm faster than anyone later on. My jiu-jitsu is always there for me."

The win not only signifies a huge moment for Diaz, but also puts him in the brightest spotlight he's had since joining the UFC after winning "The Ultimate Fighter" season 5.

While he walked into the fight as a 5-to-1 favorite, McGregor suffered his first loss in the UFC and third overall loss during his professional career. It was a devastating loss, considering he was probably looking at a welterweight championship fight with a win, but he gave credit to Diaz for accepting the fight on short notice and making the most of his opportunity.

"I thought I took him the first round. I'm humble in victory or defeat," McGregor said. "I took a chance to move up in weight and it didn't work."

The results of UFC 196 turn the entire promotion on its head after both McGregor and Holm fell to defeat. Considering how things played out on Saturday night, it's hard to imagine McGregor won't return to featherweight now to defend his title following an unsuccessful attempt to move up and conquer a new division.

Following such a monumental win, Diaz likely will have his pick of fights and he might even get a second crack at Rafael dos Anjos with the lightweight title on the line.