Afghan security forces rush towards the site of the attack in Wazir Akbar Khan in Kabul on May 26, 2015 (AFP Photo/Farshad Usyan)

Kabul (AFP) - Gunfire and explosions rang out Wednesday in a diplomatic district of Kabul as security forces battled militants who tried to storm a guesthouse owned by a prominent political family, police said, in the latest attack in the Afghan capital.

No group immediately claimed responsibility for the attack, which comes as the Taliban intensify their annual spring offensive despite Kabul's repeated overtures to reopen peace talks.

Sporadic blasts could still be heard hours after the assault began late Tuesday in the upmarket neighbourhood of Wazir Akbar Khan, home to foreign embassies and diplomatic enclaves which are a prime target for attacks.

"We have surrounded the area and cornered them," Kabul police spokesman Ebadullah Karimi told AFP, adding that no casualties have been reported.

"The attackers wanted to get into Heetal Hotel but failed. They have now taken position among the trees behind the hotel and are firing at security forces."

The manager of the Heetal Hotel, owned by the family of Foreign Minister Salahuddin Rabbani and known for housing foreigners, said all guests were in safe rooms and no one was hurt.

"Heetal is very well fortified. After one or two initial explosions, our guards started firing on attackers who were unable to get inside," manager Beizhan told AFP by telephone from inside the guesthouse.

"Gunshots and blasts can still be heard from a distance," he added, without specifying if there were any foreign guests inside.

The guest house was damaged in 2009 when a suicide bomber blew himself up outside the gate, killing eight people and wounding another 40.

Tuesday's attack began around 11:00 pm (1830 GMT). An AFP reporter near the scene heard the loud crackle of gunfire and more than a dozen explosions from the area.

- Heavy civilian toll -

The Taliban, waging a 13-year war against the US-backed Afghan government, earlier Tuesday killed 26 Afghan police in multiple attacks in the volatile south.

The militants have launched a series of attacks in the capital and around the country as NATO forces have pulled back from the frontlines.

A blast triggered by a Taliban car bomber ripped through the parking lot of the justice ministry in Kabul on May 19, killing four people and wounding dozens of others.

Also this month 14 people -- mostly foreigners -- were killed in a Taliban attack on a guesthouse in the capital that trapped dozens attending a concert.

Official efforts to bring the Taliban to the negotiating table have so far borne little fruit.

The surge in attacks has taken a heavy toll on civilians, according to the United Nations Assistance Mission to Afghanistan. In the first four months of 2015, civilian casualties jumped 16 percent from the same period last year, it said.

The Afghan government has drawn public criticism for failing to end insurgent attacks, which critics blame on political infighting and a lengthy delay in finalising a cabinet.

President Ashraf Ghani last Thursday nominated Mohammad Masoom Stanekzai, a top official in the government body overseeing the country's peace process, for the crucial position of defence minister.

The post had been left vacant for months due to disagreements between Ghani and his chief executive officer and former presidential election rival, Abdullah Abdullah.

Public criticism over the failure to appoint a defence minister has been especially fierce.

Afghan forces are now solely responsible for security after NATO's combat mission formally ended in December, with a small follow-up force staying on to train and support local personnel.

Earlier this month NATO formally announced plans to retain a small military presence in Afghanistan after 2016 to help strengthen local security forces.