KABUL, Afghanistan — Driven by increased ground combat between insurgents and government forces, civilian casualties in Afghanistan surged 24 percent through the first half of the year, reaching their highest levels since 2009, according to the United Nations. The findings were released just as a Taliban attack unfolded in the densely populated center of Kandahar, the main city in southern Afghanistan.

At least nine people were killed on Wednesday in the Kandahar assault and the ensuing gun battle, including four civilians, Afghan officials said. The battle illustrates how ground fighting, as opposed to improvised explosive devices, has emerged as the deadliest facet of the war. The United Nations report said that the death toll this year was especially high for women and children.

In Kandahar, officials said 22 attackers tried to storm the provincial governor’s office and the police headquarters shortly before noon, detonating suicide vests and car bombs. All the attackers were killed in the ensuing firefight, along with five police officers and the four civilians, said Gen. Abdul Raziq, the police chief of Kandahar Province.

The Taliban claimed responsibility, posting an account on its website that conspicuously left out any mention of the casualties.

But the twice-yearly United Nations updates on civilian deaths have regularly found the Taliban responsible for roughly three-quarters of civilian casualties, and the latest report indicated that the trend held steady through the first six months of 2014. Pro-government forces were responsible for less than 10 percent of the 1,564 civilians killed, the United Nations report said, and about 12 percent of the casualties could not be attributed to a specific party.

The report illustrated how exceptionally bloody the war has become as the composition of the forces has changed. For the most part, the Americans have stopped fighting. Now, with Afghan forces in the lead across the country, violence has surged, partly because the insurgents no longer have to worry about coalition troops coming to the aid of the Afghan forces.

The numbers, to some degree, bear this out. While insurgents were responsible for double the number of civilians killed compared with the same period in 2009, that figure has halved for pro-government forces — almost entirely the result of fewer coalition airstrikes.

The report offered a useful snapshot of an increasingly opaque war. With fewer coalition forces around the country to monitor the fighting, the country’s defense and interior ministries distribute most data and information about the violence. However, both ministries are bad about sharing accurate information on police and military casualties. The picture that emerges from their sporadic reports is that the death toll of the country’s security forces seems to be rising.

The significant increase in fighting challenges assertions made early in the coalition troop drawdown that the insurgents would be less willing to fight their fellow Afghans. The Taliban have recently been increasingly willing to engage in ace-to-face fighting against the Afghan forces, particularly in areas with dense civilian populations. As a result, civilians have been in the crossfire more and more.

“The nature of conflict in Afghanistan is changing in 2014 with an escalation of ground engagements in civilian-populated areas,” Jan Kubis, the United Nations special representative for Afghanistan, said in a statement. “The impact on civilians, including the most vulnerable Afghans, is proving to be devastating.”

The attack in Kandahar was a reminder of the dangers faced by civilians in even the most heavily guarded parts of Afghanistan. The targets — the police headquarters and the governor’s office — are in a densely populated area of Kandahar city, and the assault sparked a fierce gun battle on streets that are ordinarily packed with Afghans going about their daily routines.

The Taliban on Wednesday also dispatched hundreds of fighters to Chahar Sadra District, a remote part of Ghor Province in western Afghanistan.

Fahim Qayem, the provincial police chief, said that at least nine Taliban fighters were killed, but no police officers.

The Taliban insisted that it had killed 10 police officers. The remote location of the fighting made it impossible to independently verify either of the claims.

A version of this article appears in print on , on Page A10 of the New York edition with the headline: Ground Battles in Afghanistan Contribute to Surge in Civilian Casualties, U.N. Says. Order Reprints | Today’s Paper | Subscribe