Following an injury to lightweight champion Rafael dos Anjos ahead of UFC 196, Nate Diaz has been tapped as the replacement to step in and face Conor McGregor in the new main event on March 5 in Las Vegas.

UFC officials confirmed the new fight on Tuesday.

Dos Anjos was forced out of the fight after suffering a broken foot last week in training, and as soon as news broke that he no longer was competing at UFC 196, a slew of potential opponents began jockeying to land the marquee spot against McGregor.

More from FoxSports

Ultimately, Diaz ended up as the choice, and now he'll get the chance to face McGregor at UFC 196 next weekend. The fight will take place at welterweight with Diaz accepting it on short notice and McGregor happily accepting the move to 170 pounds.

The outspoken Stockton, Calif. native just recently defeated Michael Johnson at FOX UFC Fight Night in December, but just before that fight he was calling out McGregor for a potential matchup.

"He talks all that money fight s--t, he knows where it's at. It's right here," Diaz said in December. "It's not these guys fighting in the main event. The main event's right here. These guys already got punked out at that press conference. He already beat them. That's a win.

"If he wants to fight a real fight, he knows where's it at, he knows where the money fight's at. It's right here."

McGregor responded in kind after he won a "Fighter of the Year" award earlier this month, taking aim at Diaz and painting him as a minor leaguer in the UFC.

"I heard Nate Diaz couldn't even afford the flight over to Las Vegas for the ceremony," McGregor said in his acceptance speech.

"Stop holding bitterness deep in your bum soul. Stuck on $20,000 to show and $20,000 to fight. I wipe my ass with that money. I tip your wage, Nate, yeah."

Now the rivals will get to settle their differences inside the Octagon as the new headliner for UFC 196 in Las Vegas, with the women's bantamweight title fight between Holly Holm and Miesha Tate as the co-main event.