KABUL, Afghanistan - In a rare attack in Afghanistan's relatively calm north, a suicide bomber detonated himself next to German soldiers shopping in a crowded market on Saturday, killing three of them, along with seven Afghan civilians, officials said.

The attack in the city of Kunduz came after two German vehicles on a security patrol stopped in the market and soldiers got out on foot to do some shopping, said Kunduz provincial police chief Gen. Ayub Salangi.

In addition to the three German soldiers killed, two were seriously wounded, said German Defense Minister Franz Josef Jung, who broke short a trip to Denmark to rush back to Berlin. He said the other seven soldiers and one policemen in the group received minor injuries.

Seven Afghan civilians were also killed and 13 wounded, including seven seriously, said Azizullah Safer, the director of the provincial health department.

A purported Taliban spokesman, Zabiullah Mujahid, said a Taliban militant named Mullah Jawad from Baghlan province carried out the attack. The claim could not be independently verified.

Germany has 3,000 troops as part of the NATO force in Afghanistan. Germany's contingent is stationed in the northern part of the country, which sees relatively few attacks and is considered much safer than the south and east, where most of the country's fighting takes place.

It the worst attack against Germans in the country since a car bomb exploded near a bus carrying German peacekeepers in June 2003, killing four soldiers.

In Berlin, German Chancellor Angela Merkel called the attacks "perfidious murders" that fill the country with "disgust and horror."

"The German military is carrying out an important mission for the reconstruction and stabilization of Afghanistan. It is the goal of the attackers to destroy the established successes of this rebuilding process," she said in a statement.

German Foreign Minister Frank-Walter Steinmeier said the attack "underscores that there is no quiet or safe zone" in Afghanistan.

Although attacks in the north are rare, it was the second in a little more than a month in Kunduz. On April 16, a suicide bomber blew himself up on a police training field, killing 10 Afghan policemen and wounding 40 others. The Taliban also claimed responsibility for that attack.

The attack brings to 53 the number of international troops killed in Afghanistan this year, including 25 Americans.

Elsewhere, militants attacked U.S.-led coalition and Afghan forces about 60 miles northeast of Kabul, sparking a rare gunbattle close to the capital that killed about 20 militants and three civilians, officials said Saturday.

Afghan and allied forces were on combat patrol late Friday in the al-Asay Valley in Kapisa province, which borders Kabul province, when they were ambushed, the U.S. coalition said. The militants placed roadside bombs along the route in a "failed attempt to trap" coalition forces, a coalition statement said. Fighter aircraft then fired on the militants, the statement said.

The coalition said estimated that several dozen fighters were killed during the fight and there were no reports of civilian casualties.

Gov. Abdul Satar Murad, the governor of Kapisa province, said about 20 fighters were killed, as well as two women and a child.

While fighting in southern and eastern Afghanistan has picked up in recent weeks, battles so close to the capital are considerably rarer.

The coalition, meanwhile, said about 20 Taliban fighters ambushed coalition soldiers and Afghan police patrolling near the Pakistan border in the eastern province of Paktia on Friday, sparking an eight-hour battle that killed "a significant number of insurgents."

In eastern Afghanistan, a remote-control bomb exploded Saturday next to a police convoy, killing a district police chief and his driver and wounding three policemen in the Achen district of Nangarhar province, said Ghafar Khan, spokesman for the provincial police chief.

The attack happened as police were on their way to eradicate poppies, Khan said.