A former student charged with raping a freshman girl two days before he graduated from an elite New Hampshire prep school acknowledged Wednesday that he deleted a Facebook message to a friend in which he wrote he used "every trick in the book" to have sex with her.

Owen Labrie, 19, of Tunbridge, Vermont, took the stand as the first and only witness to testify on his behalf before the defense rested. He maintained the two had consensual sexual contact but not intercourse when he was an 18-year-old senior at St. Paul's School last year.

Prosecutors say Labrie raped the then-15-year-old girl as part of Senior Salute, a school tradition in which seniors try to romance and have intercourse with underclassmen before leaving campus. Detectives say Labrie told them seniors competed to have the most sex, keeping score on a wall behind washing machines.

In his testimony Wednesday, Labrie said he sent the girl an email inviting her to Senior Salute because he liked her.

"I wanted to ask her out," he testified, and described their relationship as "flirty."

Labrie acknowledged he told several friends in the hours after the encounter that he had had intercourse with the girl. When asked by a friend, how it had gone from "no" to intercourse, Labrie said in a Facebook reply that he "pulled every trick in the book."

"I wish I hadn't lied," he said when questioned by the prosecution. "I shouldn't have."

When prosecutor Joseph Cherniske asked Labrie if it was easy for him to lie, Labrie replied: "No."

Labrie said he deleted more than a hundred Facebook chats and messages, including ones in which he bragged of having intercourse with the girl. "They were really juvenile," he said, denying that he deleted them because they were incriminating.

He also denied that he wanted to have sex with the girl for months, even though hers was the only name he put in capital letters on a list he made in late March 2014 of girls he wanted to "slay" before school ended. A May 8 list he emailed to a friend contained the phrase "Still at Large" and the girl's name.

The girl testified last week that she initially thought Labrie's intentions for asking her to participate in Senior Salute were "really wrong," but she relented when a friend convinced her that Labrie was sincere in trying to pay attention to her. She said she was prepared for kissing at most but did not expect Labrie to become aggressive.

The girl left the courtroom in tears Wednesday as Labrie began reading from messages they exchanged just before their encounter. The emails and Facebook communications were projected on a screen in the courtroom. In one exchange, the girl says Labrie's plan to meet "sounds perfect."

The Associated Press generally does not name people who say they have been sexually assaulted. She returned to the courtroom when the prosecutor questioned Labrie.

Labrie said when they were together that night, the girl never indicated she was in pain or uncomfortable. He said he was the one who chose to end the sexual contact.

But the girl testified last week that she twice told him "no" during their encounter and that she felt "frozen" when he persisted. She acknowledged on cross-examination that she helped Labrie remove her shirt and pants and said she didn't protest because she didn't want to be offensive.

Labrie testified Wednesday that their sexual contact escalated and he got up and took a condom from his shorts pocket and began to put it on. He said that's when he had "a moment of reflection" and decided sex with the younger student might not be the best idea.

"You want all these people to think you just stopped?" the prosecutor asked.

"We just kissed but I didn't have sex with her," Labrie answered.

Labrie acknowledged asking the girl whether she was on birth control pills after she asked if he used a condom. He said he was concerned some sperm might have gotten on her underwear as their sexual encounter escalated.

"I figured she'd say 'yes' and it would give me peace of mind that nothing was going to happen," Labrie testified.

He said he never told detectives about having ejaculated during his encounter with the girl because that was "embarrassing" to talk about. But the prosecutor noted that when Labrie spoke with the detectives, he wouldn't have known that sperm was found on the girl's underwear.

The case has cast a critical light on St. Paul's School, one of eight members of a prep school Ivy League of sorts that boasts as alumni an international roster of senators, congressmen, ambassadors, Pulitzer Prize winners, Nobel laureates and other notables.

After court Wednesday, defense attorney J.W. Carney said he didn't call other witnesses because his cross-examination of the prosecution witnesses "was more than adequate for our purposes."

Closing arguments in the case are scheduled for Thursday.