A strong chemical smell that prompted more than 20 visitors to complain of throat pain at a popular Kyoto temple last week may have been caused by an animal repellent spray used nearby, the city government said Monday.

A city contractor used the spray containing capsaicin, found in chili peppers, near Nanzenji temple around the time the visitors complained of throat and other pain Wednesday morning, according to local authorities.

Police are investigating the incident as a possible case of professional negligence resulting in injury, they said.

The Kyoto city government had erected fences around the temple, located near a mountain, due to wild animals. After a camera captured images of a boar in late April, the contractor checked the site on Wednesday, found a hole dug under a fence and decided to spray the repellent around 11:20 a.m., it said.

A total of 24 people complained of throat and other pains shortly afterward and four of them were taken to hospital.

"While we have yet to identify the cause of the pungent odor, using powerful sprays near residential areas is inappropriate," said a city official.

The temple closed its doors to visitors later Wednesday but reopened the next day after finding no suspicious objects on the premises.

The temple, opened in 1291, is the head temple of the Nanzenji school of Rinzai Zen Buddhism.

(Animal spray may have caused a chemical odor that stirred Nanzenji last week.)