Peering through a gap in her black veil, Bibi Totia watched anxiously as the doctor examined her fussing grandson in a crowded refugee camp near the Pakistan border.

The doctor diagnosed flu and handed her a prescription for an antibiotic from the free pharmacy.

"God bless you," she said, clutching the precious piece of paper to her chest.

For nearly a quarter of a century, Totia has relied on the doctors of the International Medical Corps to care for her family, first as a refugee in Pakistan and now as a refugee in her own country, Afghanistan.

Although less well known than the Nobel-winning Doctors Without Borders, the Los Angeles-based nonprofit shares a reputation with its gutsy counterpart for working in places where no one else will go.

Corps staff members say they are able to work in places like Afghanistan and Iraq because they refuse to take sides, they build strong community ties and they stay under the radar. In parts of Afghanistan where government forces have little control, staffers say, they are protected by traditional village councils, known as shuras. Although Taliban militants occasionally detain the group's trucks and personnel, they are usually released within a few days.

"The Taliban are local people, and they respect our facilities because their families are coming there," said Dr. Abdul Wakil Ziar, the corps' Afghan medical coordinator. "The important thing is our staff treat all patients. There is no discrimination between Taliban and other people."

From the beginning, the corps emphasized the need to train local health workers who would keep providing care long after foreign aid groups have packed up. In the process, they helped pioneer a new approach to providing help in countries struck by war and natural disaster.

"In emergency work, what people tend to do is they swoop in, they fix things and then they leave," said Andrew S. Natsios, a former administrator of the U.S. Agency for International Development, now at the Walsh School of Foreign Service at Georgetown University. Corp members "were early leaders in the whole business of building healthcare systems."

The corps built and supplies the health center at Totia's camp, in a government-dominated area near the eastern city of Jalalabad. But the doctors, midwives, pharmacist and lab technician are all Afghans. Eventually, the group hopes to turn the facility over to the Ministry of Public Health.

"Capacity building" is now a widely accepted principle in all fields of humanitarian work. But that was not the case 25 years ago, when Dr. Robert Simon founded the International Medical Corps to help the victims of an earlier war in Afghanistan, which pitted local Muslim fighters known as the Mujahedin against an invading Soviet army.

Like most Americans, Simon had paid little attention to the conflict. Then a report by exiled Afghan doctors landed on his desk at UCLA, where he was an assistant professor of emergency medicine.

The report said Soviet forces were systematically arresting, killing or exiling Afghan health professionals, Simon recalled. In a country that had as many as 1,800 physicians before the war started in 1979, only some 200 were left. International relief groups had been ordered out of the country, so villagers had to walk for days to seek treatment at refugee camps in Pakistan and Iran, which were home to an estimated 5 million Afghans. Many did not survive the trip.

In the spring of 1984, Simon, determined to act, made his way to Peshawar, a Pakistani border town teeming with Afghan refugees, resistance fighters and U.S. and Russian spies. There he made contact with the Mujahedin, who sneaked him across the border.

Under cover of darkness, they hiked through rugged mountain passes, dodging helicopter gunships to take medical care to villagers.

Many of them were dying of measles, malaria and whooping cough. Others had lost limbs when they stepped on land mines or picked up bombs that looked like toys.

Among the sick and injured was a 5- or 6-year-old boy who was nearly comatose from an infected shrapnel wound. His father had carried the child for miles when he heard that an American doctor had pitched a tent in the Kunar Valley.

"He had lost his entire family," Simon said. "The only one left was that child."

Simon worked on the boy for 36 hours but could not save him. When he broke the news to the father, the man reached into his bag and, in appreciation for Simon's efforts, offered him the only thing he had to give: an egg.

"That's what really made me want to continue to help these people," Simon said.

After six weeks in Afghanistan, he returned to the U.S. and wrote to dozens of aid groups. Most organizations would not work in a country without the blessing of the local authorities. So in the fall of 1984, he sold his house in Malibu to raise funds to start his own organization.

He made several more trips into Afghanistan with other doctors and nurses but concluded that foreign volunteers could never entirely meet the country's massive health needs.

Soon he began taking Afghans to Peshawar for nine months of intensive training and sending them back to their villages with supplies to set up their own clinics. By focusing training on the most common ailments, he said, he could teach an Afghan medic to diagnose and treat more than 80% of the injuries and illnesses he would encounter.

"At that time, it was considered a revolutionary approach," said Nancy Aossey, the corps' longtime chief executive. "People said you just can't do what you want to do inside Afghanistan. It's too dangerous, too remote, and there's just no way you're going to be able to help people help themselves in a conflict zone."

But Simon's vision got backing from the United States Agency for International Development, which at the time was looking for a way to help inside Afghanistan, Aossey said. It gave the fledgling group a grant of more than half a million dollars. By 1990, the corps had trained nearly 500 medics who helped establish 57 clinics and 10 hospitals serving more than 50,000 Afghan patients a month, according to its annual report.

When Simon recruited Aossey to run the organization in 1986, it had just three full-time employees; they worked out of a house in Brentwood that was donated by former Los Angeles Mayor Richard Riordan. It has grown to an organization of 4,000 staff and volunteers, serving about 11 million people in 21 countries in Africa, Asia and the Middle East.

As the International Medical Corps has expanded, it has continued to focus on places where few others venture.

In Angola in 1990, Aossey was taken blindfolded through the bush to a meeting with rebel leader Jonas Savimbi at his underground bunker, to seek his blessing to work in insurgent territory. When genocide erupted in Rwanda in 1994, the corps' volunteers moved into a hospital where doctors and nurses had been hacked to death with machetes. They had to bury the bodies themselves.

But as dangerous as these conflicts could be, "we weren't really targets," Aossey said at the group's Santa Monica headquarters. That changed during the 1992-95 Bosnian war, when snipers started taking shots at humanitarian convoys. Since then, at least 10 local corps staffers and volunteers have been killed in various parts of the world.

They include three workers killed last year in an errant NATO air strike against one of the group's convoys in the Afghan province of Nursitan, Ziar said. In August, Afghan security forces got into a firefight with Taliban militants at a corps clinic in Paktika province when they tried to arrest a suspected insurgent commander who was being treated there. The Afghan forces called for backup, and a U.S. helicopter gunship destroyed one of the clinic's two buildings after patients had been evacuated, according to news reports.

Despite the risks, corps officials estimate they have trained about 1,500 Afghan health workers. Some of those graduates continued the group's work under Taliban rule, making it one of the few international organizations to have maintained a continuous presence, said country director Robert Lankenau.

Many Afghans now holding key positions in the public health system and the many nongovernmental groups that have launched programs since the Taliban was ousted in 2001 got their start with the medical corps.

"We've certainly delivered health services," Aossey said. "But the best way to deliver those services is through the local population."