CONCORD, N.H. (AP) — A former New Hampshire prep school teacher was sentenced Friday to four months in jail for telling a former student to lie about their relationship to a grand jury investigating sexual misconduct.

David Pook, of Warner, was arrested in February during a grand jury investigation at St. Paul's School in Concord, where he had taught for eight years. Investigators said he had a sexual relationship with a former student and communicated with her about her testimony, including sharing details of confidential court paperwork.

He pleaded guilty to witness tampering and contempt of court on Friday and was sentenced to 120 days behind bars. He was taken away in handcuffs.

"The conduct of this defendant and the co-conspirator sidetracked this investigation for months because of their concerted effort to lie, bold-faced and repeatedly," said Deputy Attorney General Jane Young. "For that, the time is warranted and a message has to go out to other people that when the court issues an order, people are to listen. When people raise their hand and swear to tell the truth, they better do it."

Pook answered a series of questions about whether he understood the proceedings, but otherwise declined to address the court. His attorney, Mark Sisti, told the judge that Pook took responsibility for the crimes, but said there was no evidence of a sexual relationship.

According to court paperwork, a student testified before the grand jury she believed a friend was having a romantic relationship with Pook and that they had been exchanging emails. The friend appeared before the grand jury in November and testified that she never had any sexual contact with Pook. She also testified she hadn't had any contact with him since receiving her subpoena, but phone and email records showed they were in frequent contact leading up to their testimony and discussed what she would say, said Young.

Young said prosecutors had sought the court's permission to share information about Pook with The Derryfield School in Manchester, where he was hired in 2009 after leaving St. Paul's "under questionable circumstances" in 2008. At the time of Pook's arrest, the head of St. Paul's school said Pook was dismissed for violating school rules regarding boundaries between faculty and students, and that the school should not have recommended him to The Derryfield School. He was fired from that job at the time of his arrest.

Judge John Kissinger said Pook's failure to comply with court orders made a mockery of the judicial system.

"Furthermore, to go beyond not just complying with my order but to conspire with somebody to give false testimony before the grand jury is very troubling. The fact that this occurred from somebody who held a position of trust and importance in our society is also very troubling."

The attorney general's office began its investigation last summer after St. Paul's put out its own report about sexual assaults by teachers and information about the "senior salute," a game of sexual conquest that led to the conviction of St. Paul's graduate Owen Labrie in 2015.