MILWAUKEE (AP) — Giannis Antetokounmpo wanted to see how his Milwaukee Bucks would respond to adversity after losing five straight games.

The Bucks passed that test convincingly. Now they just need to handle prosperity a little better.

Antetokounmpo had 29 points, a season-high 19 rebounds and eight assists to lead the Bucks past the Oklahoma City Thunder 98-85 on Friday night to end their longest losing streak in four years.

“Guys were ready,” Antetokounmpo said. “Guys competed. Guys played hard. Even though we weren’t knocking down a lot of shots, we competed defensively and were able to rebound and share the ball. It’s good. We’re still building.”

The Bucks, who posted the NBA’s best regular-season record each of the last two seasons, avoided their first six-game skid since March 12-22, 2015. They hadn’t lost five straight since Jan. 25 to Feb. 3 in 2017.

After the Bucks fell 110-96 to the Toronto Raptors on Thursday, Antetokounmpo said he appreciated facing adversity and being getting down because “that’s the only way you improve.” The two-time reigning MVP noted that “if everything always goes well and goes your way, you kind of not know the other side. You don’t feel it. So now we feel the other side.”

The Bucks responded by going on an 18-0 run midway through the game to lead by as many as 22 points in the third quarter. But after it appeared the Bucks were on their way to a blowout victory, Oklahoma City started to make things interesting.

“We were a play or two away from getting ourselves back in the game there,” Thunder coach Mark Daigneault said.

Oklahoma City cut Milwaukee’s lead to 83-76 on Shai Gilgeous-Alexander’s free throw with 5:26 left. Khris Middleton answered by sinking a corner 3-pointer to start a 7-0 run, and the Bucks stayed ahead by double figures the rest of the way.

“That’s just the NBA, man,” said Milwaukee’s D.J. Augustin, who had 11 points and five assists in his first start of the season. “You’ve got a couple of options. You can either be up on a team, step on their neck and put them out, or you can keep the game going and they’ll make a run. It happens. We did a great job tonight keeping our composure when it got close late in the game. We just kept doing what we wanted to do and made big plays.”

Middleton scored 20 points for the Bucks and Lu Dort had 17 for the Thunder on a night when both teams struggled on offense.

The Thunder’s 85 points were the fewest by a Bucks opponent all season. Milwaukee’s 98 points represented its second-lowest point total of the season.

Oklahoma City didn’t make its first basket of the second half until Hamidou Diallo delivered a follow shot with 4:31 left in the third.

“Certainly we were in mud,” Budenholzer said. “Maybe they were in mud a little bit. It turned into more of a half-court (game), a little bit slower.”

Oklahoma City has lost six of its last seven games, though its one win during that stretch was a 114-109 victory over the Bucks on Sunday.

TIP-INS

Thunder: Justin Jackson scored a season-high 22 points in Oklahoma City’s victory over the Bucks on Sunday, but he wasn’t much of a factor in the rematch with two points in six minutes. Jackson got more playing time Sunday because Oklahoma City was playing without Gilgeous-Alexander and Théo Maledon, who were both in the starting lineup Friday.

Bucks: Jrue Holiday missed a seventh straight game due to the league’s health and safety protocols. Reserve guard Jaylen Adams was unavailable Friday for the same reason. … Milwaukee recalled rookie second-round pick Sam Merrill from the NBA G League’s Memphis Hustle.

UP NEXT

Thunder: Visit Cleveland on Sunday to end a three-game road trip.

Bucks: Host Sacramento on Sunday in the fourth of eight straight home games. The Bucks have won their last eight meetings with the Kings.