Floyd Mayweather beat Conor McGregor -- literally and literally -- but it was way closer than just about anyone thought.

Conor ran out of gas in the 9th and Floyd opened up in the 10th with a flurry. Conor never went down but it was clearly over ... so the ref stopped the fight.

It was shockingly close ... It looked to us like Conor won the first three rounds -- the judges saw it differently. Floyd came back strong in the next 3.  

It looked like going into the 10th Floyd was winning by a razor thin margin ... but again, the judges had a wider margin in favor of Floyd.

In the end, the fighters showed respect for each other, hugging as they became ridiculously rich.

Demi Lovato kicked things off with the National Anthem.  

BELTING IT

Before that, Floyd came out in an awesome mask, to the delight of the arena.

Great fight!!!