A Three Forks man who was pleading guilty to raping a young girl for more than two years told a Gallatin County District Court judge that he has done some “stupid things.”

“I had inappropriate sex with her,” Robert Sapien, 39, told District Judge Mike Salvagni on Friday morning.

Sapien pleaded guilty to felony sexual intercourse without consent and felony sexual abuse of children as part of a plea agreement.

In exchange for his guilty pleas, two additional felony sex charges against Sapien were dropped.

The plea agreement recommends an 80-year prison sentence with no time suspended. However, the agreement is non-binding, and at the time of sentencing, Salvagni can impose a different sentence.

Maximum penalties for the two felonies are life in prison and a $60,000 fine.

Sapien has been jailed since January 2012. At that time, his victim told investigators they had been having a sexual relationship since 2009.

In October, the Gallatin County Attorney’s Office filed two new charges of sexual abuse of children after prosecutors said he recorded the girl having sex with one of his friends.

That friend, Jason Jay Norris, 41, also of Three Forks, was arrested in January and charged with felony sexual intercourse without consent.

Court documents state Norris told investigators that Sapien encouraged Norris to have sex with the girl and then recorded the encounters.

Norris remains jailed on $50,000 bail. His case is slated to go to trial for three days starting Aug. 14. If convicted, Norris is also facing up to life in prison.

Sapien’s change of plea came just four days before his case was scheduled for trial. He will be sentenced by Salvagni on Aug. 26.

Whitney Bermes can be reached at wbermes@dailychronicle.com or 582-2648. Follow her on Twitter at @wabermes.