At first, Baltimore police couldn't make sense of the savage beating deaths of three homeless men in South Baltimore this spring.

They couldn't tell if anything had been stolen. They found no eyewitnesses. And the homeless community didn't trust the detectives.

Detectives said yesterday that they unraveled the case by shedding their suits and putting on T-shirts and jeans and going to homeless encampments day after day, asking questions.

They donated 70 bags of the homicide unit's clothing to homeless men. They brought bag lunches and then got Esskay Quality Meats to donate 75 pounds of hot dogs for a cookout and Utz Quality Foods to provide hundreds of bags of potato chips.

In the last two weeks, detectives arrested three teen-agers in two deaths. The teens are suspected of killing a third homeless man in the same area, and of assaulting five others, detectives said.

Two of the teens are being held without bail at the city detention center. The third was ordered held in a Kansas jail yesterday pending an extradition hearing today, Kansas prosecutors said.

The arrests won praise from police commanders and advocates for the homeless.

"They did a spectacular job," said Col. Robert M. Stanton, who heads the criminal investigation division of the Police Department. "We had a serious problem down there, and it wasn't going away."

Detective Donald Kramer was assigned the first case: George D. Williams, 46, who was beaten with a baseball bat and found dead in March in the 1500 block of S. Eutaw St. Kramer could find no witnesses.

In late April, Detective William Ritz was assigned to investigate the death of Gerald J. Holle, 55, whose partially decomposed body was found under a bridge in Southwest Baltimore.

Ritz and Kramer quickly teamed up and began comparing notes. But the detectives weren't sure the cases were related.

The detectives then went to homeless encampments several times a week. They found it difficult to gain the homeless people's confidence: some had criminal records and wanted to avoid police, others were difficult to understand because they suffered from mental illnesses.

On June 17, another homeless man, Harry Lawhorn, was found beaten to death in the 2100 block of Russell St. and Detective Michael Glenn joined the case.

Thinking the cases were linked, Lt. Richard Fahlteich of the homicide unit assigned Sgt. Ernest Anderson to oversee the investigation.

To track potential victims and witnesses, Ritz began reading every report of aggravated assault involving homeless men in southern Baltimore going back to 1999, hoping to find similar attacks.

Frustrated by a lack of progress, the detectives organized a clothing drive and took bag lunches to the homeless camps. They soon got their first big tip: A homeless man said one of his friends had been assaulted and might talk to the detectives.

Ritz and Anderson went back that night and questioned the victim, who gave them a description of an attacker, which resulted in a composite sketch.

Other victims began coming forward and told detectives about their beatings. But the detectives needed more leads -- and organized a cookout with the donated hot dogs and chips.

That afternoon, they learned of another man who had been assaulted. That victim told them three white men had beaten him.

With the composite sketch in hand, the detectives pulled men out of prison and questioned them about assaults on the homeless and eventually learned from an inmate that some South Baltimore youths might be responsible.

That led to a tip that some teens had bragged about "bum stomping," the detectives said.

Last month, detectives rounded up the teen-agers, who lived together in the 1700 block of S. Hanover St., and questioned them.

Police arrested Harold J. Waterbury Jr., 17, and Daniel S. Ennis Jr., 16, on July 27. With the help of Kansas authorities, detectives arrested Michael W. Farmer, 17, in Wamego, Kan., on Aug. 2. Waterbury, Ennis and Farmer are charged in the death of Holle, who was killed in April. Waterbury is also charged in the death of Williams, who was killed in March.

Waterbury and Ennis, foster brothers, met Farmer when the Kansan followed his pregnant girlfriend to Baltimore and moved into the neighborhood, detectives said. Eventually, the three became friends and moved in with each other before Farmer returned to Kansas in June.

Leslie Leitch, director of the city's office of homeless services, said that the detectives showed they were "committed to solving the crimes" and that the homeless community appreciated their efforts.

"A sigh of relief has come over them," Leitch said.