BUFFALO -- A UFC 210 co-main event ended in controversy on Saturday inside KeyBank Center, as Gegard Mousasi earned a TKO victory over Chris Weidman despite referee Dan Miragliotta's initially ruling Mousasi landed a series of illegal knees.

The middleweight fight was stopped at 2:13 of the second round, when Miragliotta broke up the action due to what he thought were illegal knees to a downed opponent. Replays showed, however, that even though Weidman was knelt over, he had one hand off the canvas.

Knees to the head of an opponent who is standing with just one hand on the mat are still legal. Once Miragliotta's error was realized, it meant Weidman had received recovery time he wasn't due and the fight was called off.

Mousasi (41-6-2) did not look happy immediately after the result was read, and the New York crowd booed the situation. Weidman (13-3), who is from Long Island, looked bewildered by the situation.

"Come back," Weidman told his New York fan base. "We're going through tough times. We get held down, we come back and get stronger."

The error came at an absolutely terrible time, as Mousasi was in the midst of a potentially fight-ending momentum swing. After getting out-wrestled in much of the first round, Mousasi hurt Weidman with left hooks to the body and head in the second round.

Bleeding from the bridge of the nose, Weidman turned hard to his wrestling and did manage to get Mousasi down. He even moved to full mount, but lost position and appeared exhausted when they got back to their feet.

Weidman was attempting to end a two-fight skid. He lost in his home state in November as well, via flying knee knockout to Yoel Romero. Mousasi was on the final fight of his UFC contract.

It officially goes down as a TKO win for Mousasi, the 24th of his career. It now makes three consecutive knockout losses for Weidman.

Cynthia Calvillo defeated Pearl Gonzalez by rear-naked choke in the third round at UFC 210. Kevin Hoffman-USA TODAY Sports

Calvillo remains unbeaten

Strawweight Cynthia Calvillo (5-0) has collected two quick wins in the UFC, the latest coming via rear-naked choke against Pearl Gonzalez (6-2). The tap came at 3:45 of the third round.

Gonzalez put forth a good effort, but she was simply out-matched on the floor. Calvillo nearly submitted her in the first round with a triangle choke, but ran out of time. In the second round, she swept Gonzalez out of full mount.

On the feet, Calvillo bounced in and out of range and set up her grappling well. She converted a key takedown two minutes into the third, as Gonzalez was going for broke seeking a knockout.

Fighting out of Team Alpha Male in Sacramento, Calvillo has recorded finishes in four of her five professional fights. Gonzalez suffers her first loss since 2012.

The fight was briefly in jeopardy on Friday, under a New York State Athletic Commission policy that prevents fighters with breast implants from competition. Ultimately, NYSAC cleared Gonzalez.

Thiago Alves defeated Patrick Cote by unanimous decision at UFC 210. Josh Hedges/Zuffa LLC/Getty Images

Alves wins by unanimous decision

Brazilian welterweight Thiago Alves (22-11) dropped Patrick Cote (23-11) twice with punches, en route to a clear unanimous decision win. All three judges scored the fight 30-27 for Alves.

Immediately after the fight, Cote, 37, announced his retirement. ending a UFC career that began with a fight against Tito Ortiz in 2004.

A short left hook dropped Cote in the first round, and then a straight right did it again in the second. The Canadian managed to endure both, and a bloody facial cut in the third round from Alves's ground and pound.

Despite the damage he took, Cote continued to press Alves until the final bell. He started to windmill his right hand before throwing uppercuts and laughed and nodded after Alves nearly obliterated him with a flying knee.

For Alves, it's a strong rebound from a failed attempt to cut to 155 pounds last November. He ended up missing weight and lost to Jim Miller.

Charles Oliveira defeated Will Brooks at UFC 210 in Buffalo. Jason Silva/USA TODAY Sports

Oliveira submits Brooks

Charles Oliveira (22-7) locked in a much-needed victory against former Bellator MMA champion Will Brooks (18-3), as he secured a rear-naked finish just 2:30 into the bout.

It was Oliveira's lightweight debut in the UFC. The 27-year-old Brazilian came into the fight on a 1-3 skid at featherweight.

Oliveira took Brooks down early with an outside trip and then jumped to his back in a scramble after Brooks had managed to stand up. Brooks stood up again, but this time with Oliveira firmly attached to his back. The choke gradually sank in and Brooks had to tap.

Oliveira has been noncommittal in terms of which division he'll continue to compete in. Brooks, who fights out of Florida, falls to 1-2 in the UFC. He suffered a knockout loss to Alex Oliveira in October.