Deep underneath downtown Washington on a recent morning, law enforcement officers from four agencies were "sweeping" Metro stations, moving from trash cans and orange cones to Farecard machines and trains, looking for dynamite, C4, triacetone triperoxide and other explosives. They were using what is believed to be the most powerful defense against the type of terrorist attacks that killed 56 people last month in London: dogs.

The ability of dogs to detect 19,000 types of explosives makes them more effective at catching potential suicide bombers than security cameras or random passenger searches, officials said. Homeland Security Secretary Michael Chertoff yesterday visited a Virginia training facility for police dogs, calling them a "state-of-the-art anti-terrorist tool."

Still, terrorism experts and the police officers who work with the dogs caution that the canine units can offer, at best, spotty protection on mass transit.

Local and federal agencies have too few dogs to cover the nation's transit systems, which carry 14 million people daily. Many of the dogs can work for only about a half-hour before they need a break. And their ability to find explosives depends on the quantity and proximity of the material, the strength of the odor, the temperature and direction of the wind.

Private companies, laboratories and government research centers are working to develop technologies to replace or help the dogs. The Defense Department is conducting experiments with rats, wasps, honeybees and yeast to find other ways to detect explosives. Marines in Iraq have experimented with a $28,000 hand-held device called Fido that some of them believe can find explosives as well as a trained dog.

For now, though, the burden falls on such dogs as Andy, an energetic black Labrador retriever who works for the federal Bureau of Alcohol, Tobacco, Firearms and Explosives. He and his canine colleagues from ATF flunked out of guide-dog school because they were too keyed up to stay by a blind person's side. Their curiosity and mobility, however, make them excellent bomb-sniffers and have put them on the front lines of the nation's fight against domestic terrorism.

Andy "is really a giant nose with four legs," said Jim Cavanaugh, the ATF special agent in charge of the Washington field office. "We haven't found anything better."

But Washington's Metro Transit Police force, which trains its own dogs, has only 10 for its 86 stations. D.C. police have 10 dogs for explosives detection; the U.S. Capitol Police have 43, some helping in the subway but most used to search Capitol grounds. There are 100 ATF-trained dogs for the entire country.

Capitol Police K-9 Technician Ronald E. Potter Jr. said that a large part of the job is to walk the stations as a deterrent.

"A lot of security is to tell people, 'Hey, we're here,' " said Potter, who patrols with his German shepherd, Sandokan. "Hopefully, they feel a little safer seeing us down here."

Transit Police canine handler Mike Pecoraro said that "checking every backpack at every station, that's impossible. We can't be every place at every time. We are just one tool in the arsenal of tools against terrorism."

Washington area police officials will not say how often or where the dogs sweep the stations or trains. But the handlers said they have been working longer hours since the London bombings.

"It's very random," Pecoraro said. "I might hit 10 stations today and 10 different ones tomorrow."

Besides sweeps, the dogs are brought onto trains and platforms to check suspicious packages. That is how they were used in London before the bombings, though they are now routinely patrolling subways there.

In the Washington area, the dogs usually are not stationed at the top or bottom of escalators, where each passenger walks by. Some days, the dogs and their handlers walk through the dark tunnels on catwalks. They press flat against the wall when a train whizzes by. When it is time to get on escalators, the dogs look anxious. Their handlers hold up their tails so they do not get caught in the moving stair.

Andy's motivation is basic: the next meal. Once an ATF explosives dog has been trained, he is fed only after he finds an explosive. Three times a day, Andy's handler hides shell casings or explosives in a field, car, building or the woods. Andy, who wears his own police badge, has to "alert" Special Agent Sheila Fry, his handler, when he smells an explosive, by sitting down at the spot. Then she hand-feeds him. She has a small "dog slobber" towel attached to her belt next to her gun.

"We don't like to say he flunked out of seeing-eye dog school. I think of it as more of a career change," Fry said. Andy "couldn't overcome his desire to sniff, track and hunt. He's great at finding explosives."

Each handler uses a different command to order the dog to start working. For Fry, it is "Seek." Potter uses "Locate." Pecoraro's command to his dog Buddy is less subtle. "Find the bomb," he says.

At the Union Station Metro stop, riders stared as D.C. canine handler Jim Shieder patrolled with his German shepherd, Ben. Several riders stopped and asked whether they could pet him.

"It makes people think something is being done," said Shawn Dooley, 42, of North Brookfield, Mass., who was vacationing in Washington and riding the Metro with his wife and two children.

One man walked by and asked Shieder whether his dog would bite. "No, he sniffs," Shieder said.

"Can he sniff drugs?" the man asked, smiling nervously.

"No, just explosives," Shieder replied.

"Whew, that's good," said the man, who declined to give his name and walked away quickly, clutching his pocket.

"Working dogs" also track smells for fire and police departments and search-and-rescue teams and at airports, military bases, presidential inaugurations, immigration points and major sporting events.

Some dogs are trained to find drugs or accelerants, critical in arson investigations. Others are brought in to find humans in search-and-rescue operations. "Explosives detection canines," or EDCs, sniff only for explosives.

The dogs can detect guns and ammunition hidden in containers and cars, on people and in the ground. That has made them critical in homicides and other criminal cases, including that of the Washington area snipers, when dogs located shell casings.

A dog's nose is 100 to 10,000 times more sensitive than the human nose, depending on the odor, said Paul Waggoner, director of the Canine and Detection Research Institute at Auburn University. A dog has about 1 billion olfactory receptors, compared with roughly 40 million in humans, he said.

"They smell everything separately, where we only smell the strongest odor in the room," Fry said. "If beef stew is cooking, we smell the stew as a whole. But the dog smells the beef, the carrots and the potatoes separately. If there's one pea in the stew, the dog will know it's there."

Andy enrolled at the Canine Enforcement Training Center in Front Royal, Va., for six weeks of classic Pavlovian conditioning with explosives. His personality was then "matched" with Fry, an ATF agent for 13 years who grew up on a farm in Minnesota and loves animals. The two went through 10 more weeks of training to cement their relationship. They live together, and, each year, Andy is retested and recertified by the ATF.

But some dogs have not been trained so rigorously. Two years ago, a federal judge imposed a 61/2-year sentence on a Hagerstown, Md., man who provided the government with bomb-sniffing dogs that could not reliably smell explosives.

The dogs failed a "covert operational test." When federal officials drove past them in cars loaded with 50 pounds of dynamite, 50 pounds of TNT and 15 pounds of plastic explosive, the dogs "didn't so much as sneeze," jurors were told.

Staff writer Mary Jordan reported from London. Staff writers Lyndsey Layton and Laura Blumenfeld also contributed to this report.

"A lot of security is to tell people, 'Hey, we're here,' " says Capitol Police K-9 Technician Ronald E. Potter Jr., who patrols with his German shepherd, Sandokan.