A registered sex offender was sentenced Thursday to 20 years in prison for raping a 13-year-old girl he met online and sexually assaulting her 14-year-old friend.

James Mason III, 30, of Annapolis, had run-ins with the law starting at age 12, and this case represented his fourth and fifth sex crimes, according to Anne Arundel County prosecutor Kathleen Rogers.

"This is completely within your character, taking advantage of people sexually," Anne Arundel County Circuit Court Judge Paul A. Hackner said to Mason.

Hackner said the girls were looking for an evening of fun on July 8, 2010, and were vulnerable. Rogers said that Mason plied the teens with alcohol and that after they had become ill, they were sexually assaulted.

Rogers said after court that she was satisfied with the sentence.

Mason received the maximum — 30 years — with 10 years suspended, and must serve five years of probation upon release. Mason also has a probation violation pending in Prince George's County and could receive an additional five years in prison. He will be on the sex offender registry for life.

Mason told the judge Thursday that he did not take advantage of the girls. He picked up the 13-year-old, with whom he had developed an online friendship, in Dundalk along with three of her companions, after she told him they wanted to go drinking, he said.

Mason denied assaulting anyone and said he thought the girls were older.

"I didn't force myself on anyone," Mason said. "Had I even guessed that they were that young, I wouldn't have put myself in that situation."

Mason said he accepted responsibility. In June, however, he entered an Alford plea, maintaining his innocence but acknowledging that prosecutors had enough evidence to convict him.

Exactly what Mason knew about the girls and their intentions for the evening led to a dispute between Rogers and Mason's lawyer, David W. Fischer.

The 13-year-old identified herself as 18 on her MySpace page, Fischer said. In addition, he contended, the girls were seeking older men. Neither the two girls nor their parents came to court Thursday or provided written victim impact statements, Fischer pointed out.

Rogers rebuffed a suggestion that girls went looking for trouble and found it.

After Mason picked the girls up, they stopped at a liquor store, then went to Mason's friend's home in the Broadneck area. After doing shots, at least three of the girls became sick, Rogers said at Mason's plea hearing in June.

He took the 13-year-old with him to McDonald's and sexually assaulted her in his car before going through the drive-in for food and returning to the house, she said. Mason then took a 14-year-old outside and sexually assaulted her, Rogers said. Investigators suspect that another man in the house sexually assaulted a third girl, but Rogers said the girl did not want to press charges.

The girls then locked themselves in a bathroom, where one texted her father, saying they were scared, didn't know where they were and that one of them had been raped, Rogers said. Her father contacted Baltimore County police, who were able to determine their approximate location from the girl's cellphone.