Security services in Azerbaijan say they have arrested 40 suspects and seized weapons as they thwarted a series of planned terror attacks against the Eurovision Song Contest.

Targets included the song contest venue and major hotels housing foreigners, the National Security Ministry said in a statement Wednesday.

Azerbaijan has in recent months reported being the target of terrorist activities planned by groups with ties to Al-Qaida and Iran, and this appears to be most extravagant alleged plot revealed to date.

An oil-rich nation of 9 million people wedged between Russia and Iran, Azerbaijan has nurtured close relations with the United States and played an active role in Western-led counter-terrorist programs. That policy has placed a strain on its ties with Iran, which hosts a sizable ethnic Azeri community.

The statement Wednesday said other plots included plans for an assassination attempt on President Ilham Aliyev in April, as well as attacks on religious pilgrimage sites and police stations.

Officials said 40 people have been arrested. Weapons seized included 13 assault rifles, one machine gun, 12 handguns, three rifles, 3,400 rounds of bullets, 62 hand grenades, and several kilograms of explosives.

The statement provided no details on when the arrests took place.

"The armed group set itself the aim of mounting terrorist attacks in several regions of Azerbaijan, creating a mood of powerlessness and lawlessness, sowing panic, ethnic and religious enmity, disrupting the public peace and damaging Azerbaijan's international image," the statement said.

The Eurovision attack would have centered on the Baku Crystal Hall, where the singing competition concluded early Sunday, officials said. Other planned targets included Marriot and Hilton hotels in the capital, Baku.

At least one suspected plotter, 37-year-old Azerbaijani citizen Vugar Padarov, and a security agent were killed during raids to shut down the terrorist group, the statement said.

Padarov was identified in an April security statement as the leader of a group that had received religious training in Syria. Some of its members had weapons training with the Jihad Islami group in Pakistan and took part in fighting NATO-led troops in Afghanistan, the National Security Ministry said.

In March, the ministry announced the arrests of 22 Azerbaijani citizens it said had been hired by Iran to stage terror attacks against the U.S. and Israeli embassies as well as against western-linked groups and companies. It said they had been trained in Iran by the Revolutionary Guard.

Earlier this year, it announced the arrest of several other suspected terrorists allegedly working for Iran's secret services.