HOUGHTON, MI - A former Michigan Technological University student who was expelled for a perceived threatening social media post has been compensated more than $42,000 as part of a lawsuit settlement agreement.

Matthew Schultz received a refund of the $27,881 he paid to the university, as well as $14,500 for "other expenses related to Mr. Schultz attending the university," for a total of $42,381, according to the settlement agreement, which was released to MLive by the university under the Freedom of Information Act.

Additionally, the former third-year engineering student had his disciplinary record cleared by Michigan Tech. He will not return to the university, according to a statement by Jennifer Donovan, director of news and media relations for Michigan Tech.

"The parties now agree that Matthew did not intend any physical harm," Donovan said. "The parties agree that Matthew's dreams of a successful career in mechanical engineering should not be compromised and are encouraged."

Schultz was expelled from the university after an online post from Nov. 12, 2015 triggered uproar at the Upper Peninsula school. The post, published on Yik Yak, read, "Gonna shoot all black people...... A smile tomorrow." It was followed by a smiley face.

The post was up for five minutes when it was flagged by another user and removed. Soon after, former Michigan Tech student Ryan Grainger shared a screenshot of the post with Les Cook, vice president of student affairs and advancement, via Twitter.

Grainger also allegedly sent an email to Brian Cadwell, the university's deputy police chief, which only showed the "Gonna shoot all black people" portion of Schultz's post, according to the lawsuit.

"A non-student's role, including alteration of Matthew's original post, worsened the situation," Donovan said. "Grainger has acknowledged his role in causing a disruption on Michigan Tech's campus and regrets the harm caused to Matthew's education and reputation."

Schultz was arrested for domestic terror, a 20-year felony. He was instead charged with a misdemeanor for disturbing the peace, which was ultimately dismissed.

The lawsuit accused university officials of failing to reveal that they received two versions of the post, leaving out the "A smile" portion of Schultz's message. On Dec. 7, 2015, the same day all charges were dismissed, the school's conduct board held proceedings against Schultz and placed him on probation for 18 months.

Schultz appealed the decision. Bonnie Gorman, associate vice president and dean of students, then reinstated the most serious charges against him and ordered him expelled with no right to appeal, the lawsuit said.

The settlement agreement, signed in June, was approved by U.S. District Judge Gordon Quist. As a condition of the settlement, Schultz released all claims against the university, Grainger, and the remaining 11 university-related defendants in the case.

"Matthew has asserted that his post was in no way intended as a threat of violence, and was protected speech under the First Amendment," Donovan said.

"Michigan Tech understood the post differently, and believes its actions in response were justified in light of its knowledge at the time, its interests in keeping its campus safe, and its obligation under federal law."

Each party was responsible for paying their own attorney fees and costs.

Reporter John Agar contributed to this report.