An MD 530F military helicopter on Tuesday targets a house where attackers are hiding in Kabul, Afghanistan. The Taliban fired rockets toward the presidential palace in Kabul Tuesday as President Ashraf Ghani was giving his holiday message for the Muslim celebrations of Eid al-Adha, said police official Jan Agha. Credit: Rahmat Gul | AP

KABUL, Afghanistan — Rockets were fired Tuesday toward the presidential palace in Kabul as the Afghan president was delivering his holiday message for the Muslim celebrations of Eid al-Adha, police said, prompting a ferocious aerial response, with helicopter gunships bombing the house from where the rockets were reportedly launched.

Police initially blamed the Taliban, but an Islamic State affiliate later issued a brief statement saying it had fired mortar shells at the presidential palace. There was no immediate comment from the Taliban.

The first rocket landed somewhere near the presidency building, while the second hit near a NATO compound and the U.S. Embassy, but no one was hurt, said police official Jan Agha.

The boom of the rockets was heard in the live broadcast of President Ashraf Ghani’s speech. Ghani interrupted his message to say: “If they are thinking the rocket attack will keep Afghans down, they are wrong.”

The area where the rockets hit is one of the most secure in the Afghan capital, where embassies and government buildings are surrounded by high cement blast walls and coils of razor wire. Many streets near the U.S. Embassy are closed off, as well as those near sensitive government and military installations.

Kabul police spokesman Hashmat Stanekzai said Afghan police had noticed a suspicious vehicle earlier Tuesday and followed it to a mud-brick house near the sprawling Eid Gah mosque, where hundreds had gathered to pray during the Eid al-Adha holiday. Stanekzai told The Associated Press that the militants are believed to have fired the rockets from the house.

A helicopter gunship was called in and bombed the location, destroying the house and the vehicle.

Eyewitnesses at the scene said that after the explosions, sporadic shooting could be heard from the area, though it wasn’t clear who was firing. The witnesses spoke on condition of anonymity, fearing for their safety.

Another police official, Mohammed Akram, said four attackers were apparently involved, though it was unclear if any survived the helicopter assault on the house. Police were combing the area in the heart of Kabul, where crowded open-air markets intrude on old residential areas of mostly poor, mud-brick homes.

Interior Ministry spokesman Najib Danish later said all the attackers were killed. Two members of the Afghan security forces were wounded in the firefight, which also ignited a fire in a nearby market, he said.

The assault on the major Muslim holiday came amid an unrelenting wave of attacks across the country in recent weeks and dealt another blow to Ghani’s efforts to revive peace talks to end the 17-year war. On Sunday, Ghani had offered a conditional cease-fire to last during the holiday, saying it would only take effect if the Taliban reciprocated.

Both the Taliban and IS are fighting to overthrow the U.S.-backed government and impose a harsh form of Islamic rule. But they are fiercely divided on leadership, tactics and ideology, and routinely clash with one another.

The Taliban have been at war for nearly 17 years, and have stepped up attacks in recent months, seizing rural districts and carrying out major assaults against security forces and government compounds on an almost daily basis.

On Monday, Afghan forces rescued nearly 150 people, including women and children, just hours after the Taliban ambushed a convoy of buses and abducted them in the northern Kunduz province.

The quick response marked a rare if limited battlefield success for the troops after weeks of unrelenting insurgent attacks.

Earlier this month, the insurgents launched a coordinated assault on Ghazni, a strategic city only 75 miles from Kabul and the capital of a province with the same name. They seized several neighborhoods, and it took security forces, aided by U.S. airstrikes and advisers, more than five days to drive them out.

The battle for the city killed at least 100 security forces and 35 civilians, according to Afghan officials. The Defense Ministry said about 200 militants were killed.

In neighboring Pakistan, new Prime Minister Imran Khan condemned the “cowardly” attack in Kabul.

Ghani had criticized Pakistan following the attack on Ghazni, and both the United States and Afghanistan have accused Pakistan of harboring Taliban militants. Islamabad denies the accusations.

The U.N. special representative to Afghanistan, Tadamichi Yamamoto, pleaded for peace on the Muslim holiday.

“To allow all Afghans to commemorate this auspicious celebration, I strongly urge the parties to the conflict to demonstrate good will, to respect this time of joy and tolerance and to refrain from resorting to violence,” he said.

Taliban leader Maulvi Haibatullah Akhunzadah released a holiday message on Saturday, saying there would be no peace in Afghanistan as long as the “foreign occupation” continues and reiterating that the group will only negotiate directly with the U.S.

The U.S. and NATO officially ended their combat mission at the end of 2014 but have repeatedly come to the aid of Afghan forces in recent years to prevent the Taliban from advancing into major cities.

The Taliban have sent delegations to Uzbekistan and Indonesia in recent weeks, raising their diplomatic profile even while carrying out deadly attacks. The Taliban say they met with a U.S. diplomat in Qatar earlier this month for what the group described as “preliminary” talks, and said it expected further negotiations.

Associated Press photographer Rahmat Gul and writers Kathy Gannon and Munir Ahmed contributed to this report.

Follow the Bangor Daily News on Facebook for the latest Maine news.