The Cosmos finally defeated their nemesis, Indy Eleven, for the first time in eight tries Wednesday night, but they still suffered a major loss at Shuart Stadium.

Veteran defender Hunter Freeman played his final game with the reigning North American Soccer League champions, an emphatic 3-0 triumph over 10-man Indy, as the team confirmed they had completed a deal that will send him to Miami FC.

Juan Arango scored twice and Ruben Bover once for the Cosmos (8-2-2, 26 points; 14-6-2, 44), who solidified their lead atop the North American Soccer League fall season and overall standings, respectively. The Cosmos, who played the final 37 minutes with a man advantage after Indy’s Cory Miller was red-carded, extended their home unbeaten streak to 17 games (15-0-2).

”It was good to beat them for the first time,” coach Giovanni Savarese said. “It was three very important three points for us.”

While the Cosmos ended their 0-1-6 drought against Indy while defeating an opponent at home for the second time in five days, Freeman stole the spotlight.

Playing alongside captain Carlos Mendes, Freeman anchored a backline that helped goalkeeper Jimmy Maurer record his eighth shutout of the season and the club’s ninth.

advertisement | advertise on newsday

Freeman, 31, who leaves for Miami Thursday, was approached by the club and received an offer that reportedly was double his salary. Savarese would not say how much the team received from Miami, only that it was in six figures.

“For him, it was important money,” said Savarese, adding that the Cosmos were “pro-player,” and that the team isn’t going to stop a player from moving.

An original member of the rebooted Cosmos team in 2013, Freeman was a valuable member of two Soccer Bowl championship teams (2013 and 2015).

“It’s tough hearing the news,” Mendes said. “Hunter is a huge part of the club. He’s going to be missed. It’s what’s best for him, best for his family.”

Bover lifted the Cosmos into the lead in the eighth minute, converting a Jairo Arrieta pass into a goal.

@NewsdaySports

Arango doubled the lead after Nemanja Vukovic was called for a handball in the penalty area in the 17th minute. He fired his attempt into the lower right corner as goalkeeper Jon Busch dove in the opposite direction. After booting a penalty kick into the stands in the 54th minute, Arango iced the game with his second, heading home Bover’s left-wing cross in the 73rd minute.