Stephen A. Smith gets animated over the judges' unanimous decision to give Jeff Horn the victory over Manny Pacquiao. (2:12)

Manny Pacquiao was the heavy favorite to retain his welterweight world title against unknown Jeff Horn in what most viewed as an easy fight, and Pacquiao sure looked like he had done just that when the final bell rang to end the action-packed brawl.

Pacquiao had rocked Horn, bloodied him and nearly stopped him in a violently one-sided ninth round. But then the judges' scorecards were read, and Pacquiao was the victim of a hugely controversial decision, as Horn was awarded a stunning unanimous decision -- a hometown decision, many will call it -- before 51,052 at Suncorp Stadium in Brisbane, Australia, on Saturday night (Sunday morning in Australia).

Judge Waleska Roldan had it 117-111, and judges Chris Flores and Ramon Cerdan both had it 115-113 for Horn. ESPN.com scored the fight 117-111 for Pacquiao, and ESPN ringside analyst Teddy Atlas had it 116-111 for Pacquiao.

Jeff Horn, right, defeated Manny Pacquiao in a massive upset, with all three judges scoring it in Horn's favor, 117-111, 115-113 and 115-113. Chris Hyde/Getty Images

Pacquiao, the Filipino legend and boxing's only eight-division world champion, has been here before, losing a split decision and a welterweight world title to Timothy Bradley Jr. in 2012 in one of the most controversial decisions in boxing history. Like he was after that loss -- which he avenged twice -- Pacquiao was gracious after his bout with Horn.

"That's the decision of the judges. I respect that," Pacquiao said.

Freddie Roach, Pacquiao's Hall of Fame trainer, also took the high road.

"I have to go along with Manny and say I respect the decision of the judges," Roach said. "Well, two of the judges [who had it 115-113]. I did think Manny won, but Jeff Horn showed a lot of heart. He is a big, strong fighter, and I congratulate him."

Pacquiao, 38, holds the contractual right to a rematch, and he said he would exercise it.

"Absolutely, yes," Pacquiao said of fighting Horn again in Australia. "We have a rematch clause, so no problem."

The fight, which aired live on ESPN, was Pacquiao's first non-pay-per-view bout since 2005 and was supposed to be a showcase. That Horn was still standing at the end of the tough fight was a surprise, but Pacquiao looked to be the clear winner -- until his belt was handed to Horn, a 29-year-old former Olympian and former school teacher with a very thin ring résumé.

Punch stats Punches Pacquiao Horn Landed 182 92 Thrown 573 625 Percent 32% 15% -- Courtesy of CompuBox

Horn seemed as shocked as anyone that he got the decision, if body language means anything, but he said he thought he won what will go down as the biggest fight in Australian history.

"I thought I was coming forward more and landing the cleaner blows," Horn said. "That's just my opinion."

Asked how he managed to win, he struggled for words at first.

"I don't know. I guess with the crowd behind me and all the support," said Horn, who was Pacquiao's mandatory challenger. "I've just believed since I was young that I could do this. There's lots of thoughts going through [my mind]. I managed to get the decision. It was close."

It did not appear to be all that close, however, even though the action far exceeded the modest expectations going into the fight. Pacquiao also dominated the CompuBox punch statistics, getting credit for landing 182 of 573 blows (32 percent), while Horn landed 92 of 625 (15 percent). Pacquiao also landed more punches in 11 of the 12 rounds, according to CompuBox.

Horn (17-0-1, 11 KOs) tried to rough Pacquiao up and landed a couple of shots in the first round, but Horn also had his mouthpiece dislodged. Still, Horn was extremely aggressive and busy.

But Pacquiao came back strong in the second round, landing two very solid straight left hands, but the chin of Horn, who has been knocked down a few times in his career, held up.

In the third round, Pacquiao continued to land and opened a cut over Horn's right eye, which got worse as the fight went on.

Horn was trying very hard to land big punches and spent the fight bulling forward and trying to smother the faster Pacquiao (59-7-2, 38 KOs).

In the sixth round, an accidental head-butt opened a cut on Pacquiao's hairline, and blood streamed down his body. Then Horn rocked Pacquiao with a right hand in a stunning scene. Pacquiao quickly recovered, but it had to give Horn confidence.

Pacquiao, right, said he would "absolutely" exercise his contractual right to a rematch against Horn. Chris Hyde/Getty Images

There was another accidental head-butt in the seventh round, and it cut Pacquiao again, this time near his left eye, and more blood streamed down his face. Horn went right at Pacquiao after the ringside doctor took a look at the cut, and the crowd got very excited.

"I feel his power. He is strong," said Pacquiao, who after the fight needed nine stitches to close the cut on the hairline and eight stitches to close the cut by his left eye.

But Pacquiao, a southpaw, had a huge ninth round. He turned up his aggression and battered Horn, landing numerous brutal shots, especially with his left hand. Horn took them all and refused to go down, but he was in rough shape at the end of the round. Referee Mark Nelson went to Horn's corner and told him he would not let him continue to take punishment and strongly considered stopping the fight. Horn convinced him to allow the fight to go on.

"He was a tough opponent," Pacquiao said. "I tried to knock him out in the ninth round, but he survived. In the ninth round, I thought I am going to win the fight."

Horn said he felt Pacquiao's power in the ninth round but was able to recover.

"I felt fine in that corner. I wanted to keep going on," Horn said. "I wasn't really that hurt. I was a little bit buzzed in that round, but I recovered very quickly. He buzzed me a little bit. I felt a little off-balance in that round."

Pacquiao, who was making the first defense of the title he won via lopsided decision against Jessie Vargas in November, continued to go after Horn in the 10th round. Horn looked spent but was somehow able to remain on his feet as he continued to show his enormous heart.

The 12th round was another intense one, as Pacquiao, without a knockout since 2009, tried to close the show. But Horn also fought hard until the final bell, thinking he might be able to land a big shot. When the fight ended, the crowd erupted. Pacquiao pumped his fists, and Horn's cornermen raised him up.

And then came the shocking reading of the scorecards by ring announcer Michael Buffer.

"I am professional. I respect the judges. He survived that [ninth] round," Pacquiao said, adding that the two cuts from the head-butts bothered him.

"It affected me. A lot of blood came out of my head," he said.

Pacquiao, who made at least $10 million to Horn's $500,000, also said he was a little under the weather, having picked up a cold upon his arrival in Australia a week earlier, but he did not harp on that.

Instead, he graciously stood at ringside next to Horn as they were both interviewed.

Horn, who is a huge Pacquiao fan and said he drew inspiration from him earlier in his career, was still seemingly in awe that he got the decision. He had the belt over his shoulder and as he walked away from ringside, he first went to Pacquiao and said, "Manny, you're an absolute legend. Thank you."