The relief agency Medecins Sans Frontieres (search) said Wednesday it was pulling out of Afghanistan, discouraged by a fruitless investigation into the slayings of five of its workers and fearful of new attacks as a bombing targeting election workers left at least two dead.

The Nobel prize-winning group's decision to withdraw was the most dramatic example yet of how deteriorating security has crippled the delivery of badly needed aid and reconstruction in Afghanistan since the Taliban (search) regime was ousted more than two years ago. MSF had already suspended most of its work after the June killings and recalled all foreign staff to Kabul, the capital.

"Today's context is rendering independent humanitarian aid for the Afghan people all but impossible," the international group said in a statement.

In the latest violence, a bomb exploded Wednesday in the town of Andar, 90 miles southwest of the capital, as Afghans lined up at a mosque to register for ID cards for voting in Oct. 9 presidential elections.

U.N. and Afghan officials said at least two people were killed, including an Afghan member of the electoral board, and several others were injured.

Three rockets fired into Kabul (search) overnight set off a secondary explosion at an Afghan military arms dump and blew a hole in the road in front of the Chinese Embassy, but injured no one.

Anti-government militants are blamed for many of those attacks and the deaths of more than 30 aid workers since March 2003, making the south and east virtually off-limits. The assault on the MSF workers in northwestern Badghis, the deadliest yet on an international relief agency, raised fears that the north was also becoming too dangerous.

Medecins Sans Frontiers, or Doctors Without Borders, cited three main reasons for its pullout: dangers on the ground, dismay that the investigation into the June killings produced no results, and what it called the U.S. military's use of humanitarian aid "for political and military motives."

U.S. and NATO troops run several so-called Provincial Reconstruction Teams across the country, under which soldiers provide health care, dig wells and perform other work normally carried out by civilians. Aid groups have long feared that the practice blurs the lines between relief work and soldiers' efforts to persuade local communities to provide intelligence on militants.

The U.S. military rejected the suggestion that its aid projects were endangering civilian lives.

"We don't put anyone in danger," spokesman Maj. Jon Siepmann said. He said many aid groups were working effectively in areas where American troops also operated. Others "need to direct their concern toward the Taliban, towards Al Qaeda. We do nothing here but help."

In the June 2 killings of its workers, two men on a motorcycle stopped a clearly marked MSF vehicle on a rural road in northwestern Baghdis province. The three Europeans and two Afghans inside were shot dead.

A purported Taliban spokesman claimed responsibility and accused the victims of working for American interests — a shock to MSF, which like many agencies relies on neutrality to protect workers who venture into war zones. Investigators have not ruled out a link to feuds among local warlords.

Police arrested 13 people over the killings. But Amir Shah Naibzada, the police chief in the area where the killings occurred, said Wednesday that all had been released. "We're still trying our best to find out who did this," he said.

Medecins San Frontiers said the government's failure to conduct a "credible investigation" was a factor in its decision to withdraw.

It was unclear when the estimated 80 international volunteers and 1,400 Afghan staff who worked for the medical relief agency in Afghanistan before the attack would stop their work for good. The group was expected to hand over its clinics and other programs to Afghan health authorities and other nongovernment organizations.

MSF has been working in Afghanistan for 14 years. The group, which won the Nobel Peace Prize in 1999, provides basic health care and support to hospitals in 13 of the country's 34 provinces.