Purdue coach Matt Painter thought he scripted a simple final play Sunday.

Jaden Ivey messed it up, then found a way to make up for his miscue.

When the sophomore guard saw Eric Hunter Jr. pinned in the corner, Ivey freed himself on the wing in front of the Boilermakers bench and delivered a tiebreaking 3-pointer with 0.6 seconds left to give sixth-ranked Purdue an 81-78 victory over No. 16 Ohio State.

"With seconds left, I just went to the ball and got my hands on the ball," Ivey said. "It was supposed to be for Zach (Edey), but I just got confused, honestly. Sometimes you’ve just got to make a play."

Ivey has delivered repeatedly this season as the Boilermakers top scorer. This time, he scored 21 points and made 3 of 6 from beyond the arc after coming off the bench for the second straight game since missing one game with an injured hip flexor.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Purdue guard Jaden Ivey (23) shoots the game winning shot over Ohio State guard Eugene Brown III (3) in the second half of an NCAA college basketball game in West Lafayette, Ind., Sunday, Jan. 30, 2022. Purdue won 81-78.

Purdue guard Jaden Ivey (23) shoots the game winning shot over Ohio State guard Eugene Brown III (3) in the second half of an NCAA college basketball game in West Lafayette, Ind., Sunday, Jan. 30, 2022. Purdue won 81-78. (AP Photo/AJ Mast)

Edey added 20 points as the Boilermakers (18-3, 7-3 Big Ten) won their fourth in a row and beat their 28th ranked opponent in the past six seasons.

It sure didn't look like Purdue would need Ivey's big shot when it jumped out to 52-32 lead with 14:35 remaining. But Ohio State (13-5, 6-3) charged back, finally tying the score when Kyle Young intercepted the Boilermakers inbound pass after E.J. Liddell cut the deficit to 78-75 with 33.5 seconds left.

The Buckeyes again swung the ball to Liddell, who knocked down the tying 3 with 25.3 seconds left. They just couldn’t keep the ball out of Ivey's hands, even if wasn't by design.

"We did anticipate them making an action for Ivey," coach Chris Holtmann said. "I thought Gene (Brown III) was there a little bit. But give the kid credit, he made the shot."

For the Buckeyes, it was a deflating finish after they methodically fought their way back. Liddell and Malaki Branham each scored 20 points to lead Ohio State, which never led in the second half as its three-game winning streak ended.

"We didn't do what we were supposed to do and normally the basketball gods aren't with you when that happens," Painter said after moving within two wins of No. 400 in his career. "We just got lucky. because Ohio State played really well down the stretch."

BIG PICTURE

Ohio State: Holtmann's squad was playing well coming into this game and finished strong. But it struggled mightily, especially from 3-point range over the first 25 minutes. Though the Buckeyes wound up shooting 31% from beyond the arc, they struggled with Purdue inside. The loss should reinforce just how critical it is to play a full 40 minutes.

Purdue: The Boilermakers can overwhelm opponents in multiple ways and demonstrated it again Sunday. Purdue drew early fouls by repeatedly going inside, which opened the perimeter and driving lanes for Sasha Stefanovic and Ivey. This is the combination that makes Purdue one of the nation's top teams. They just need to develop a stronger finishing touch.

POLL IMPLICATIONS

A solid road victory followed by a win over the Buckeyes should be enough to keep Purdue in the top 10 for a 13th consecutive week — and might be enough to put the Boilermakers back in the top five. Ohio State will likely slip a few spots following a road loss against a strong foe.

BACK IN BLACK

Purdue wore black jerseys with "volt accents" for the annual Hammer Down Cancer game. The jerseys and warmup shirts eventually will be auctioned off with the proceeds being donated to the Purdue Center for Cancer Research.

STAT PACK

Ohio State: Center Joey Brunk has played against the Boilermakers with Butler, Indiana and now the Buckeyes. ... Guard Jamari Wheeler returned to the starting lineup after sitting out with a foot injury Thursday, ending a streak of 143 consecutive games in which he appeared. ... Branham had seven rebounds.

Purdue: Stefanovic scored eight of his 11 points during one first-half flurry that helped swing the game. .., Hunter finished with 10 points and five assists while Trevion Williams had nine points and eight rebounds. Mason Gillis had seven points and 11 rebounds.

UP NEXT

Ohio State: Returns home to face Iowa on Thursday.

Purdue: Visits Minnesota on Wednesday.