Japanese towns are attempting to keep bears away with sounds that irritate them after an increase in attacks, including the mauling of a Spanish tourist.

The 40-year-old man was in the popular sightseeing spot Shirakawa-go, a Unesco-listed village of traditional thatched-roof farmhouses in central Honshu, when a young Asian black bear approached from behind and clawed his arm.

Shirakawa village in autumn during fire fighting training.

The attack left the man with slight injuries but only a few days before a woman was killed and another went missing after attacks by bears. There have been more than 90 bear sightings in the area since the beginning of the year.

A record seven people have been killed in bear attacks across Japan this financial year, according to its environment ministry. Erosion of natural habitats and scarcity of food are thought to have pushed bears closer to populated areas.

As well as fireworks and traps, devices that emit high-pitched sounds have been deployed in populated areas to keep the animals away.

In Fukushima prefecture, units equipped with motion sensors and solar panels have been set up along a pathway that bears use to descend from higher elevations along the Arakawa River. The closer they get to the sound generators, the harsher the noise gets.

An acoustic device with a solar panel for deterring bears in Fukushima.

Proponents say the devices are a humane, nonlethal solution to bear incursions.

“This new system randomly emits various piercing sounds that bears cannot adapt to,” Shota Mochizuki, a wildlife management expert and associate professor at Fukushima University, told the Asahi Shimbun newspaper. “The combination of frequencies is not comfortable to their eardrums, triggering the instinct to flee.”

• Tourists love Japan, but under the surface it’s a Land of Rising Anger

There have been record sightings of bears in the Fukushima area, in eastern Honshu, this year, including 140 in the city itself between April and August, twice the annual average.

This month two people in the Nagano and Miyagi prefectures, also on Honshu, were found dead after suspected bear attacks. On the northern island of Hokkaido two hunters were attacked by a brown bear after it broke free from a deer trap.

Last month an Asian black bear broke through a window and entered a nursing home in Aizu, known as a historic centre of samurai culture, but ran off without injuring anyone.

Bears can become accustomed to the noise of firecrackers, but scientists say that will not happen with the random electronic sounds. The devices produce frequencies within a range of 20 to 20,000Hz to match that of a bear’s hearing. Tests of the units in Nishiaizu were said to have been effective.

The units will remain in place until bears enter hibernation around the end of the year, and then be reinstalled in spring. The town was the first to allocate public funds to the technology, earmarking 3 million yen (£14,800) for the project as an emergency measure.

Last month Japan eased gun rules to make it easier for hunters to use rifles in built-up areas as an additional measure to stop bear attacks.

After the attack on the Spanish tourist, the Shirakawa-go village closed popular tourist trails. “There are some tourists who take photos in off-limit areas,” an official said. “It’s dangerous. We urge people not to do that.”