NORTHAMPTON, Mass. (AP) — A Pittsfield man convicted of raping a University of Massachusetts freshman in her Amherst dorm room has been sentenced to eight to 12 years in prison.

Justin King also was sentenced Monday in Hampshire Superior Court to five years of probation with several conditions after he leaves prison.

The 21-year-old King was convicted last week.

He was one of four men charged with raping the woman in October 2012 after they drank alcohol and smoked marijuana. The woman said she told the men not to visit her, but they were allowed into the dorm by another student. They were not students but knew the woman. He is the second defendant to be convicted. Two other men await trial.

King testified that that encounter was consensual. His lawyer says he plans an appeal.