A former State Department official was sentenced to 32 months in prison for secretly filming women in their homes. (WUSA9)

The woman told the court that she had thought it was impossible she was a victim of a former State Department official who lurked in dark corners of the city filming dozens of women in intimate moments in their homes.

She said that Daniel Rosen, 45, would have had to creep through an alley, along a driveway and up 15 steps to reach her window, which has bars and is cloaked with a black curtain. So when a D.C. detective played her one of hundreds of Rosen’s videos, she was horrified.

She instantly recognized her naked body. Rosen had found the smallest chink in her curtains to record her with his iPhone.

Rosen was sentenced to 32 months in prison Wednesday for the collection of videos he created of women bathing, grooming and even having sex with their partners. He pleaded guilty to 11 misdemeanor charges of stalking and voyeurism in July as part of a deal with prosecutors.

“Daniel crept through alleys and up stairwells like an animal,” the victim told a D.C. Superior Court judge. “He has made my neighborhood a hunting ground. I don’t know if I’ll ever feel safe in my home again.”

The case was unusual in part because Rosen was a prominent counterterrorism official with the State Department during the day and carried out his crimes under the cover of darkness in the Mount Pleasant, Adams Morgan and U Street neighborhoods.

Before he was sentenced, Rosen spoke at length about his crimes. He apologized to the victims, said he was in counseling and added that he would not offend again. He said his crimes began at a time when his career, marriage and health were going downhill. His wife, who has stood by him, sat nearby in the courtroom.

He also said he was grateful to have heard from a victim during the hearing.

“I told myself for a long time I wasn’t hurting anybody,” Rosen said. “I know that’s not true.”

Prosecutors say in court documents that Rosen began filming women in December 2010 and continued through 2014. Sometimes, he would use the guise of walking his dog, and twice he talked his way out of trouble after being stopped by D.C. officers who were suspicious of his activities.

Rosen returned to some victims again and again, and some of his videos stretched on for minutes. All the videos were filmed in the neighborhoods surrounding his Mount Pleasant home.

In one case in October 2012, Rosen filmed a topless woman as she sat on her bed and engaged in a sexually explicit video chat with her boyfriend. In other cases, women were filmed as they read books in the bath, brushed their teeth or walked through a kitchen.

Rosen’s activities were discovered in March after he was caught in an online sting carried out by Fairfax County police. Rosen allegedly made plans to meet with a detective posing as a 14-year-old girl.

Rosen’s attorney said that Fairfax detectives discovered a cache of nude photos of women on his phone and turned them over to D.C. police. Rosen is scheduled to stand trial on charges related to the Fairfax case in January.

Rosen cooperated with investigators after his arrest, leading them to the locations where he shot many of the videos. Still, a prosecutor said that many more victims could not be identified because Rosen could not remember all of his many filming locations.

The victim who spoke in court Wednesday said she was profoundly unsettled by the experience. She said she sought counseling and would break down emotionally at the slightest provocation. She said she felt re-victimized by knowing that police and attorneys had to watch the video Rosen made of her. The Washington Post generally does not identify victims of sexual crimes.

After the hearing, the woman said she was happy that Rosen got jail time but believed that someone who had committed such extensive crimes should face stiffer penalties. Judge Rhonda Reid Winston told Rosen during the hearing that he should have known better.

“You are a person who came to the court highly educated and intelligent and who had the means to address this problem before we got to this point,” Winston said.