An 18-year-old Massachusetts student athlete accused of rape and sexual assault will avoid jail time, a criminal record, and the sex offender registry if he meets the terms of his probation for two years.

David Becker, a recent graduate of East Longmeadow High School, was charged in April after two female classmates said they had fallen asleep after drinking at a house party. Each of them said they had awoken to Becker inserting his finger in their vagina, court records said. Sufficient facts existed to find Becker guilty of rape and two counts of indecent assault and battery, according to the records.

Prosecutors had sought to take Becker to trial. If found guilty, prosecutors wanted to put the teen behind bars for two years.

But, as allowed under Massachusetts law, Palmer District judge Thomas Estes accepted Becker's admission to the facts and granted a continuance of two years. If Becker meets the judge's terms, the case will then be dismissed. Terms include staying drug and alcohol free, undergoing a sex offender evaluation and following any recommended treatment, staying away from the victims, and writing a letter of apology.

Jail time would have been "appropriate and fair" in the case, a spokesman for the Hampden District Attorney's office told BuzzFeed News.

"After careful consideration of all available information and a lengthy and thorough investigation by Hampden District Attorney Anthony Gulluni’s Special Victims Unit and the East Longmeadow Police Department, the recommendation of two years jail time was deemed appropriate and fair based on the facts and circumstances of the case," the statement said.

Becker's attorney said the sentence would allow the teen to move on with his life and have a "college experience," The Republican newspaper reported. The probation was structured to allow Becker to move to Ohio, where he had planned to go to college.

"He can now look forward to a productive life without being burdened with the stigma of having to register as a sex offender," Becker's attorney, Thomas Rooke, told the court. "The goal of this sentence was not to impede this individual from graduating high school and to go onto the next step of his life, which is a college experience."

The sentence sparked outrage online, drawing comparisons to another recent controversial sex case involving a student athlete. In June, Stanford University swimmer Brock Turner was sentenced to six months in jail — a departure from the recommended minimum of two years — after he was found guilty of sexually assaulting an unconscious woman.

In Becker's case, the allegations came to light after a police officer assigned to the high school heard a rumor that two students had been sexually assaulted by another student while drunk. The officer contacted the alleged victims, each of whom said they experienced nonconsensual sexual contact.

Each of the 18-year-olds said they had been drinking at a party at the home of a friend. The young women had had five or six drinks each when the party was broken up, and they went to an upstairs bedroom and fell asleep.

Becker had stayed with several others to help clean up, one of the teens said. She woke up around 5 a.m., and he was touching her, she said.

"She stated that she awoke and found David had pulled her pants and underwear down to her thighs and had his finger in her vagina," the police officer wrote. "She stated that at no time did she consent to David touching her."

She got up and went downstairs, then immediately received a text from Becker, records said. "Sorry, it's my fault," the message said, according to records. The teen said she then fell back asleep on a couch.

Becker texted her again at 7:48 a.m., the teen said. "Very sorry about last night I was very much in the wrong and was an embarrassment...I understand if I'm not you favorite person right now. Just wanted you to know that I am really sorry."

To police, she said she sent a message back, "dont even worry about it it's all good," because she didn't know what else to say.

The other teen said she remembered Becker coming into the room and talking to her and her friend as she fell asleep. She said she woke up twice to feel a hand under her clothes, but she pushed it away. She woke again to feel someone touching her inside her vagina, and she said she again pushed the hand away. She woke up later in the morning as Becker was leaving and saying goodbye to her; no one else was in the room, she said.

In a statement to police, Becker said he had not touched the second teen. The first teen did not stop him when he put his arm around her, he said.

"He stated that once she did not stop him he thought she was okay with it and he began to 'finger her' unaware she was asleep," the officer's report said.

One of the teens also told authorities she had heard that Becker had acted similarly with other girls before.

"His friends sometimes refer to him as 'David the Rapist,'" records said.

On a Facebook page, Becker had indicated he was going to attend the University of Dayton.

Classes at the Catholic university in Ohio begin Wednesday.

"He will not be attending here," a university spokesperson told BuzzFeed News.