WEST LAFAYETTE, Ind. -- Raphael Davis made one of two free throws with 4.6 seconds left in overtime Tuesday night to help No. 18 Purdue pull off an 82-81 upset over No. 8 Michigan State.

The Boilermakers (20-5, 8-4 Big Ten) snapped a seven-game losing streak in the series despite blowing an 18-point second-half lead, trailing by four late in regulation and allowing the Spartans to tie it at 81 with 11.5 seconds left.

Davis broke the tie with the decisive free throw, giving him 24 points. A.J. Hammons wrestled the second shot away from Michigan State (20-5, 7-5) to seal it.

Hammons had 19 points, 13 rebounds and eight blocks.

Denzel Valentine led the Spartans with 27 points, eight rebounds and 10 assists.

Purdue led 48-30 early in the second half but Michigan State rallied and led 72-68 with 1:59 to go before the Boilers scored four straight to force overtime.

Davis was sensational in the first half, scoring 19 points to match his season high and setting a career high by making all five of his 3-point attempts. He managed only five points in the second half but matched his career-best scoring total with the decisive free throw.

Valentine was just as flashy in the second half, knocking down three 3s in a 49-second span to get the Spartans within 50-44.

It was that kind of wacky night.

Michigan State never led until Matt Costello's layup with 7:40 left and then appeared to be pulling away.

The Boilermakers tied the score on Caleb Swanigan's short jumper with 1:03 left in regulation, giving both teams a chance to win it.

But Swanigan's 30-footer bounced hard off the backboard with 15 seconds to go and Hammons tossed up an airball on the rebound with 11 seconds left for a shot clock violation.

Valentine's 3 at the buzzer was way off the mark, too.

DOMINANT NO MORE

The Spartans hadn't just been beating Purdue -- they had been blowing them out. The win was Purdue's first in the series since Feb. 2, 2011, and six of the seven Michigan State wins were by double digits.

TIP-INS

Spartans: Michigan State came in with the nation's most lopsided rebounding advantage (plus-12.8) but got outrebounded 42-39. ... Costello blocked one shot to tie Drew Nymick (134) for No. 3 on the school's career list. Costello needs nine blocks to get Branden Dawson's school record (142). ... Costello scored 11 points and Matt McQuaid had 10.

Boilermakers: Are still the only Division I team that has not been outrebounded in a game this season. ... Purdue improved to 14-1 at Mackey Arena. ... The Boilermakers' bench was outscored 25-18 on Tuesday, marking the second time this season it has been outscored

UP NEXT

Michigan State hosts Indiana on Sunday.

Purdue visits Michigan on Saturday.