Ministry spokesman Arif Babayev told RFE/RL's Azerbaijani Service that several alleged members of a terrorist group had been arrested.
"A terrorist attack by a criminal group against state facilities and the embassies of member states of the antiterror coalition has been prevented," Babayev said. "A criminal case has been launched and an operation is under way to neutralize other members of the criminal group."
He said that during the operation, one person who had put up armed resistance was killed and that a large amount of weapons was discovered.
Earlier today, the British Embassy in Baku closed and the U.S. Embassy scaled down its operations because of a security threat.
"The embassy has reduced its activities today because of a security threat against the embassy," Jonathan Henick, a public affairs officer with the U.S. Embassy, told RFE/RL. "The embassy remains open but we are not providing all the usual services that we provide to visa applicants and to American citizens."
The British Embassy also declined to reveal the nature of the security threat that had forced it to close.
Crackdown On Islamic Groups
The alleged attack comes amid a crackdown in recent days by the Azerbaijani authorities on what they say are extremist Islamic Wahhabi groups in the country.
And local media have reported that in the northern province of Zakatala students wearing veils were not allowed to attend classes.
Following the collapse of the Soviet Union, there has been a resurgence of Islamic belief in Azerbaijan –- often fuelled by foreign groups.
In the early 1990s, Saudi, Kuwaiti, and Turkish foundations built mosques and madrasahs and sent missionaries. Iranian imams often took up residence in Azerbaijani mosques.
Since the end of the 1990s, the government has moved to control religion -- in particular religious education.
Curriculums are approved by the government's Muslim Board of the Caucasus. The authorities put pressure on "dissident" teachers. Madrasahs not registered with the state face closure.
Critics say the government is using the threat of extremism to clamp down on dissent.
And some analysts say that with the country's impotent and discredited opposition, Islam is well placed to become a political force in the future.
There is a growing gap between rich and poor and popular anger at the ruling elite for perceived corruption.