A former FBI analyst who snooped on a conservative activist’s emails said Friday that he was trying to protect former special counsel Robert S. Mueller III from a smear campaign.

“I did what I did to try to protect Director Mueller, who can protect himself,” Mark Tolson, 60, said in Alexandria federal court. “I’m terribly sorry.”

He was sentenced to seven days in jail for going without permission into the email account of Jack Burkman, a conspiracy theorist who claimed without evidence last year that Mueller committed sexual assault.

“You can’t just rummage through other people’s accounts,” U.S. District Judge Leonie M. Brinkema said.

Tolson had Burkman’s password because his wife had been employed by the right-wing lobbyist, a neighbor in Arlington. The day before a Nov. 1 news conference at which Burkman promised to produce the alleged rape victim, Tolson and his wife got into the email account and began taking images. They offered Burkman’s password to a reporter, who declined to accept it, according to court documents.

Tolson then brought the information to his bosses at the FBI and admitted what he had done. He said that “because of the press coverage” of Burkman’s claims, “I felt I had to go to the media.”

Defense attorney Ed MacMahon said that before this incident, Tolson was a “model employee,” who was “trying to discredit a news conference that was about to start, at which salacious allegations were going to be made about Mueller.”

Brinkema questioned Tolson’s urgency, saying that even in this “overheated environment” Burkman’s claims “would not be taken seriously.”

In fact, the news conference received little attention. No accuser appeared, and media coverage was largely focused on Burkman’s unzipped fly.