The Bethesda resident and her friend were just watching a football game in her living room.

Then she saw an object waving back and forth outside the sliding glass doors of her apartment.

It was a camera on a stick — a selfie stick, the gizmo invented to let people take photos of themselves from farther away.

Or, in this case, to take illegal photos of other people. Montgomery County police allege that taking pictures is just what the Bethesda resident’s neighbor had been doing, without her knowledge, for more than a year.

Donald Frazier Beard, 60, has now been charged with using his selfie stick to record at least 16 videos of the 58-year-old woman, including one that showed her naked.

In court documents, police said that the victim was in her apartment on Montrose Avenue in Bethesda when she noticed the camera on the metal stick. She went to the door and called out, “What are you doing?” The camera was quickly yanked away, and she heard the door to one of the apartments adjacent to hers click shut.

She called police, who confronted Beard. According to the court papers, Beard said he was using his camera to “spy” on his neighbor, “but just for investigative purposes.”

He wanted to collect evidence of the woman spending time with married men so he could present the evidence to their wives, he told police. He also said he found her “attractive” and “had not asked her out.”

Beard told police he had deleted the photos he took of the woman, according to the court documents. But when they searched his electronic devices, police said they found numerous videos and photographs of the woman and of her car taken from September 2013 to November 2014.

Stanley J. Reed, Beard’s attorney, said on Wednesday that Beard will plead not guilty. Reed declined to discuss the case further.

According to court documents, Beard recorded a sort of audio diary of his own activities and his neighbor’s. The document mentioned recordings with statements including, “It is 5:01 a.m. on the 24th of March. She is in bed. I just got up. It’s Monday. Trash day. 28 degrees outside.”

Another recording: “She came home last ten minutes from the pool. I have laundry in. She came home while I was downstairs.”

The videos of the woman in her apartment were all taken using a selfie stick, police spokeswoman Natasha Plotnikov said.

The court documents said that Beard had specifically labeled the file on his computer in which his neighbor appears topless in the video.

After the woman learned of Beard’s alleged recordings, she asked a Montgomery County court in June for a protective order to keep him away from her.

She listed the questions that were making her anxious. She wrote: “Is he still video taping me? Has he bugged my computer? Who else has he [done] this to? Can he potentially harm me?”

But the court denied her request for a protective order. In documents, a judge said that the woman could not meet the burden of proof required for the order.

Dan Morse contributed to this report.