Joshua MacKenzie of Alberta, Canada, was arrested Tuesday in Coeur d'Alene.
He made an initial court appearance on Wednesday on charges of rape, sexual exploitation of a child and tampering with evidence. His bond was set at $50,000 and if released, he was ordered to stay at least 300 feet away from the girl. A preliminary hearing was set for July 15 and MacKenzie was assigned a public defender.
Kootenai County prosecutors say MacKenzie and the girl had been having sexual conversations online for several months. Court records say MacKenzie picked up the girl Monday night and took her to a hotel.
Sgt. Christie Wood says the girl's mother called police the next day after learning what happened.