CHARLESTON, W.Va. — The West Virginia House on Thursday approved limits on drone use in the state with criminal penalties for adding weapons, harassing others, interfering with airplanes or taking photographs of people through the windows of their homes without permission.

The bill, adopted 78-18, would establish a misdemeanor for operators of unmanned aircraft to knowingly view or take pictures or videos of people on private property where a reasonable expectation of privacy is violated. It also would be a low-level crime to intentionally harass someone or fly it with “wanton disregard” of others’ safety or property, in violation of a restraining order or in a way that interferes with police or emergency medical personnel.

The measure was prompted by a particular incident in which a visiting couple saw a drone hovering over the bathroom window at their daughter’s home, said Delegate Tom Fast, a Fayetteville Republican. He said the drone was operated by a registered sex offender from a nearby yard, who claimed on Facebook that there was no law against it.

“The bill doesn’t create an offense for the filming of property without permission,” said Delegate Roger Hanshaw, vice chair of the Judiciary Committee. “The bill creates an offense for use of the unmanned aerial vehicle to take photographs in circumstances under which an individual has a reasonable expectation of privacy.”

It specifically would prohibit “capturing, or recording through a window” of a private residence. Hanshaw said it wouldn’t apply to businesses.

The possible misdemeanor penalty would be up to a year in jail and a fine of $100 to $1,000.

Delegate Larry Rowe, a Charleston Democrat, opposed the bill, predicting a chilling effect on media use of drones in reporting. “I think this clearly chills our First Amendment right to know what’s going on in our communities,” he said.

Operating a drone with a gun or other deadly weapon, except for official military or police purposes, would be a felony. Operators also could face one to five years in prison and fines ranging from $1,000 to $5,000 for deliberately flying a drone to interfere with manned aircraft, also a felony.

Those with Federal Aviation Administration authorization to operate unmanned aircraft for commercial purposes could fly them in West Virginia “consistent with federal law and the provisions of this article,” according to the legislation.