A Kittery man could face up to five years in prison after pleading guilty Wednesday to engaging in a type of cyberstalking known as “sextortion.”

The U.S. Justice Department and U.S. Attorney John P. Kacavas of New Hampshire said in a press release that John Bryan Villegas, 23, of Kittery pleaded guilty in federal court to interstate stalking.

Justice Department officials said that Villegas is scheduled to be sentenced on Jan. 7, and could face a maximum sentence of five years as well as a maximum fine of $250,000.

Court documents and an affidavit filed by U.S. Secret Service agent Michael Peck indicate that Villegas, from July 10 to July 16, 2012, sent multiple email messages to a woman in Dover, N.H., identified in court records as Jane Doe.

Villegas told the woman that he had obtained “X-rated” photographs of her and demanded that she email more photographs and videos of herself engaging in “various sexually explicit scenarios.”

As proof, he emailed her several sample photographs.

Investigators said the private photos obtained by Villegas had been stored on the woman’s laptop computer, which was stolen during an April 2012 burglary.

When she refused to comply, Villegas threatened to “dox” her, meaning that he would distribute the photographs on the Internet, to her ex-husband, her boyfriend and to a recent former employer.

Peck in his affidavit says that Villegas worked in a U.S. Navy medical unit at the time of the cyberstalking.