Each officer had found a niche on the D.C. police force. One specialized in traffic problems, and the other concentrated on cracking down on prostitution.

Colleagues said both tackled their assignments in the same way -- through hard and tenacious work. That dedication will be remembered at two funerals in coming days as D.C. police grapple with the sudden deaths this week of two promising, popular sergeants in the performance of their duties.

The last time the D.C. police department recorded line-of-duty deaths in such quick succession was in 1997, when three officers were fatally shot within three months, officials said.

"There were a lot of tears," Assistant Chief Alfred J. Broadbent said. "They were both dedicated. It's definitely a tough loss."

Sgt. John S. Ashley, 37, collapsed and died Sunday as he chased a runaway dog in Northwest Washington. Sgt. Clifton Rife II, 34, died early Wednesday after an off-duty gunfight with a youth who tried to rob him in Oxon Hill.

Ashley's funeral is scheduled for 11 a.m. today at St. Leo's Catholic Church in Fairfax. Services for Rife had not been scheduled as of last night. Scores of police will honor both men, who had many supporters on and off the force. Because Rife was fighting a crime, his death, like Ashley's, was ruled to have been in the line of duty.

"This is going to be tough on a lot of people," Police Chief Charles H. Ramsey said. "They were both very good."

Ashley, a seven-year veteran who lived in Vienna, was on routine patrol at 5 p.m. Sunday when he spotted a dog running away from its handler in the 1600 block of 30th Street NW, according to police officials.

The sergeant jumped from his police car and began chasing the dachshund. He collapsed and was rushed to George Washington University Medical Center, where he died. Police officials said Ashley, who has a daughter, suffered a heart attack or a sudden illness from an undiagnosed heart condition.

Later, police learned that the dog had escaped from George Stephanopoulos, a former top official with President Bill Clinton's administration and host of the ABC News show "This Week."

Stephanopoulos had been walking the dog, named Gilbert, with his family in a nearby park when the pet ran away. A neighbor later picked up the dog.

"It's such a sad story," Stephanopoulos said. "It's made me heartsick."

Other officers said they were not surprised that Ashley would leap from his patrol car to help. He was an aggressive officer who enjoyed assisting people and working on neighborhood problems, especially traffic issues.

Even though he was a plainclothes detective stationed in Anacostia before his promotion to sergeant in February, he volunteered for overtime traffic duty.

During his traffic endeavors, he bonded with Alma Gates, a community leader in her Palisades neighborhood. She was so impressed with Ashley's energy and willingness to slow down speeders that she lobbied the 2nd District's commander to put the newly minted sergeant in her neighborhood.

"He was really concerned that our streets should be safe," Gates said. "I am personally devastated. . . . He just made a difference."

The police department honored Ashley two years in a row for his traffic work. "It was one of those things where he felt he could make a difference," said Lt. Patrick Burke, a close friend.

He also was among detectives who investigated the bombing of a Chevy Blazer in a Northwest Washington garage in July 2002. Prescott Sigmund later pleaded guilty to setting the bomb, which seriously injured his half brother, Wright Sigmund. Agents from the federal Bureau of Alcohol, Tobacco, Firearms and Explosives credited Ashley with helping to solve the case.

Rife demonstrated that same kind of dedication, according to fellow officers and supervisors. After he had finished serving subpoenas Wednesday morning, he went to visit a friend at an apartment in Oxon Hill, police said.

He was ambushed on the way to the apartment by a masked youth with a gun. Rife and Jonathan M. Washington, 16, exchanged gunfire. Rife died later at Prince George's Hospital Center, and Washington was pronounced dead at the scene.

Rife, a 13-year veteran, lived in Odenton and had two young children. Co-workers said he never forgot his roots on the street and was always focused on the job.

After becoming a supervisor in the prostitution unit in 2002, Rife pushed his detectives to achieve results, and arrests jumped 38 percent within a year. During his career, Rife was commended 16 times by his supervisors for excellent work -- an extraordinary personnel record, top police officials said.

"You just couldn't mold a better supervisor, sergeant or human being," Capt. Mario Patrizio said.

Rife, known for being fearless and willing to take chances, rushed into a burning house in 1996 and rescued several sleeping residents, police officials said.

"He was one of those guys, an all-around guy," Assistant Chief Winston Robinson said. "He made an arrest every day. He was in court every day. He made a lot of cases and a lot of lockups.

"He was a role model."

Sgt. John S. Ashley, 37, collapsed while trying to catch a runaway dog Sunday in Northwest Washington. Sgt. Clifton Rife II, 34, died early Wednesday after a robbery attempt; his assailant was killed as well.