The Iranian army's ground forces began holding manoeuvres near the country's border with Azerbaijan on Friday, state media reported, despite criticism from its neighbour.
The exercises took place in open areas in northwestern Iran, said state television, which showed tanks, howitzers and helicopters firing at targets on the ground.
"We respect good neighbourly relations but we do not tolerate the presence of Zionist regime (Israeli) elements and Islamic State terrorists in the region," ground forces commander Brigadier General Kioumars Heydari told state TV.
Azerbaijani President Ilham Aliyev had criticised the Iranian war games in an interview published on Monday.
"Every country can carry out any military drill on its own territory. It's their sovereign right. But why now, and why on our border?" he told Turkish news agency Anadolu.
His comments were rebuffed by Iran's foreign ministry spokesman Saeed Khatibzadeh.
"The drills carried out by our country in the northwest border areas... are a question of sovereignty," Khatibzadeh said in a statement on Tuesday.
Before dawn on Friday, the Iranian embassy compound in Baku came under "attack", ambassador Abbas Mousavi told his country's official news agency IRNA, without giving details.
"The Republic of Azerbaijan identified, arrested and questioned four people who attacked the Iranian embassy in Baku at midnight," he said, adding that Tehran had protested vigorously the incident.
Iran and Azerbaijan share a border of around 700 kilometres (430 miles).
Ethnic Azeris make up around 10 million of Iran's 83 million people.
A major supplier of arms to Azerbaijan, Israel came under diplomatic fire from Armenia during last year's conflict between the Caucasus neighbours.