Featherweight champion Conor McGregor had stepped up two weight classes to fight Diaz in March but submitted to the Californian in the second round.
On Saturday, in a much-hyped rematch at the T-Mobile Arena, both fighters did heavy damage but neither could find the knockout blow over five bloody rounds.
Judges gave Ireland’s McGregor a majority decision victory, setting the stage for a lucrative third fight.
McGregor downed Diaz early in the first round with a stinging left hand and fought a tactical battle, peppering his opponent’s front leg with kicks.
Diaz hit the deck twice early in the second round but McGregor declined to take the fight to the mat, signalling for Diaz to get up.
Known for his durability, Diaz then landed two telling strikes of his own, forcing McGregor back against the cage towards the end of the round and grabbing the momentum.
Diaz came close to finishing it in the third but McGregor somehow stayed on his feet despite a series of heavy blows.
Both fighters were struggling with fatigue in the final two rounds, which were heavy on clinches around the cage, and Diaz managed to take McGregor down in the final seconds of the fifth.
The flamboyant McGregor is the biggest draw in the UFC, and earned $3m fee for Saturday’s fight.
While a third fight between the two would be a huge draw, the UFC is keen for McGregor to defend the featherweight title he won by beating Jose Aldo last December or to vacate it.
In Saturday’s co-main event, top light heavyweight contender Anthony Johnson knocked out Glover Teixeira with a thundering right uppercut to put himself into contention for a title fight against champion Daniel Cormier.