After Kofi Cockburn gets the basket and draws the foul, he accidentally hits referee Lewis Garrison in the head while celebrating. (0:31)

Lewis Garrison, a college basketball official, left a matchup between Illinois and No. 5 Michigan on Wednesday night after he was accidentally hit by Kofi Cockburn as the freshman center celebrated a key play in the Illini's 71-62 victory in Champaign, Illinois.

After Cockburn scored and drew a foul late in the second half, he turned to celebrate and threw his right arm in the air, making contact with Garrison, who then fell to the floor.

Cockburn appeared to hit Garrison with his elbow and forearm.

The official grabbed his head and struggled to get to his feet. He was helped off the court and taken to a hospital for a precautionary X-ray.

A Big Ten spokesman said Garrison was released from the hospital Wednesday night.

"Official Lewis Garrison was treated and released last night and hopes to resume officiating as soon as this weekend," Jason Yellin told ESPN.

Cockburn immediately went to help Garrison after the play and shook his head as he watched the official leave the floor.

"[Cockburn] didn't see him," Michigan coach Juwan Howard said as he recalled the sequence. "He hit him in the back of his head. Doesn't matter. If you have an official's jersey or an opponent's, I care about his health. As you can see, we had to finish the game with two referees. I just hope he's OK."

The odd moment overshadowed a stellar performance by Cockburn, who finished with 19 points, 10 rebounds and four blocks in Illinois' first win over a top-five program since 2013.