KABUL, Afghanistan - A suicide bomber blew up his car outside a small residential hotel frequented by foreigners just after dawn Tuesday, killing four guards, as two other militants stormed the hotel in Kunduz city and engaged the Afghan police in a two-hour gunbattle.

The Taliban claimed responsibility for the assault -- the latest in a rising number of attacks in northern Afghanistan.

The explosion rocked the neighborhood all around the house in Kunduz city, said Mubobullah Sayedi, a provincial spokesman. "When the bomber blew himself up, the explosion shook everything," Sayedi said. "It broke glass everywhere."

Four Afghan building guards were killed and 10 other people, including an Afghan policeman, were wounded, Sayedi said. Foreigners staying at the two-story hotel escaped through the rear of the building, he said.

Sarwar Husseini, a provincial police spokesman, said German aid workers often stayed in the house, but that it was not clear who the foreigners staying there when the attack took place were. The Interior Ministry said the house was used by GIZ, a German development and assistance organization that contracts mostly with the German government.

A GIZ spokesman said the building is used by a security company called Kabora, which provides security for the German organization, and that the building is not used to house GIZ employees. While there are GIZ international and Afghan staff living in Kunduz, they live in other houses, he said.

"GIZ was not the target," spokesman Hans Sterling said. He said his reports show the building was used as an office rather than a hotel. Officials with Kabora could not immediately be reached for comment.

Taliban spokesman Zabiullah Mujahid said in a text message to The Associated Press that the assailants had attacked a "German intelligence center and security company."

The inn burned and several nearby buildings were damaged. Flames could be seen shooting up an exterior wall as police contained the area. A severed leg lay on the ground, while other body parts had been collected and tied up in a blanket.

"We heard a very big explosion that shook all of Kunduz," said Ahmadullah, a 30-year-old shopkeeper in Kunduz, who lives about 10 metres from the building. "It was a very strong explosion."

Ahmadullah, who uses just one name, said he and his family quickly ran out of the neighborhood to a relative's house nearby. Worried that they were still too close to the fighting, they moved even farther away to seek protection in another relative's house.

"All my children were so scared," he said. "We have never been so close to a suicide bombing."

Fighting has been focused in southern and eastern Afghanistan, but insurgents have been conducting a rising number of attacks in the once-peaceful north.

Late last month, a vehicle carrying the deputy governor of Kunduz province struck a roadside bomb, injuring three of his bodyguards. In June, a bombing at a bazaar in the province killed at least 10 people. Also in June, three policemen were killed when a suicide bomber blew himself outside a mosque and another bomber hit a German NATO convoy, killing three civilians.

In May, a suicide bomber infiltrated a high-level meeting in neighboring Takhar province and killed northern Afghanistan's top police commander, Gen. Mohammed Daoud, provincial police chief Shah Jehan Noori and two German soldiers. The German NATO commander in northern Afghanistan was wounded.

Late last year, a suicide bomber killed Kunduz Governor Mohammed Omar and 15 other people at a mosque in neighboring Takhar province.