At least three rockets hit near the presidential palace on Tuesday shortly before Afghan president Ashraf Ghani was to give an address to mark the major Muslim holiday of Eid al-Adha.

There were no injuries and the rockets landed outside the heavily fortified palace grounds, said Mirwais Stanikzai, spokesman for the interior minister.

No-one immediately claimed responsibility for the rocket attack, but police quickly fanned out across the area.

One car parked on a nearby street was completely destroyed; the police said it was used as launching pad for the rockets.

The palace is in the middle of a so-called Green Zone that is fortified with giant cement blast walls and barbed wire, and streets near the palace have long been closed off.

The barrage came as the US and Nato complete their final withdrawal from Afghanistan.

Many Afghans are worried whether their war-ravaged country will fall deeper into chaos and violence as foreign forces withdraw and the Taliban gain more territory on the ground, having captured several districts and key border crossings with neighbouring countries over the past weeks.

The withdrawal is more than 95% complete and the final US soldier will be gone by August 31, president Joe Biden said in an address earlier this month.

"This Eid has been named after Afghan forces to honour their sacrifices and courage, especially in the last three months," Mr Ghani said in his address to the nation following morning prayers for Eid al-Adha, or the "Feast of Sacrifice".

"The Taliban have no intention and willingness for peace," Mr Ghani said. "We have proven that we have the intention, the willingness and have sacrificed for peace."

However, Afghan forces have complained about being left without reinforcements and supplies, often running low on food as the Taliban advanced. In many instances, Afghan troops surrendered rather than fight.

Washington's watchdog monitoring US spending in Afghanistan reported that troops are deeply demoralized and corruption is rampant. After their pull-out, the US and Nato are committed to spending $4 billion annually on Afghan forces until 2024, the majority of that money coming from Washington.

Mr Ghani said he deplored his government's decision to release 5,000 Taliban prisoners to get peace talks started last year as a "big mistake" that only strengthened the insurgents.

Yet he has released other prisoners, including several sought by warlord Gulbuddin Hekmatyar, with whom he signed a peace deal in 2017.

Among those freed at Hekmatyar's request was Abdul Basir Salangi, who killed two US military personnel in 2011 in Kabul.

Meanwhile, Abdullah Abdullah, the No 2 official in the government, was inside the palace during the rocket attack on Tuesday, having returned on Monday from peace talks with the Taliban in Qatar. Those inside the palace, however, were far removed from where the rockets landed.

The two days of meetings in Doha - the highest level of negotiations between Kabul and the Taliban so far - aimed at jumpstarting stalled talks but ended with a promise of more high-level talks.

In his speech, Ghani also assailed neighbouring Pakistan, which Kabul blames for harbouring the Taliban leadership and providing a safe haven and assistance to the insurgents.

In the most recent fighting in the Afghan border town of Spin Boldak, Taliban fighters were seen receiving treatment at a Pakistani hospital across the border in Chaman.

Pakistan is seen as key to peace in Afghanistan. The Taliban leadership is headquartered in Pakistan and Islamabad has used its leverage, which it claims is now waning, to press the Taliban to talk peace.

Pakistan has also been deeply critical of Kabul, saying it has allowed another militant group, the Pakistani Taliban - Tehreek-e-Taliban Pakistan - to find safety in Afghanistan from where they have launched a growing number of attacks targeting the Pakistan military.

"Pakistan does not want a Taliban regime in its homeland" but their media have been "campaigning for a Taliban regime in Afghanistan," Ghani added.

The Eid al-Adha is the most important Islamic holiday, marking the willingness of the Prophet Ibrahim - Abraham to Christians and Jews - to sacrifice his son.

During the holiday, which in most places lasts four days, Muslims slaughter sheep or cattle and distribute part of the meat to the poor.