A Northeast Washington man, who said he could not take the stresses of his life anymore, was charged with first-degree murder yesterday after he told D.C. police that he stabbed two handicapped children to death and tried to kill himself in the shelter for the homeless where he was living with the children, police said.

Stanley Simpson, 31, told police that he stabbed the two boys -- Dwayne Stephen Barnes, 8, and Jerome Clayton Barnes, 4 -- several times shortly after midnight, police said. Both boys had cerebral palsy and used a wheelchair, police said.

The slayings occurred only days before city social workers were to have appeared in court for a hearing on their request to take custody of the children because of the family's problems. District officials yesterday said that a D.C. Superior Court judge in recent months has twice denied the custody request, but had ordered social workers to continue monitoring the situation.

"It seems to be apparent that there was some judgment that the family environment was not safe for these children," said M. Jerome Woods, director of the D.C. Department of Human Services. "That's why we went to court to get custody."

Simpson and the children's mother had been arrested numerous times on drug charges, police said. It could not be determined yesterday whether any of the arrests resulted in convictions.

Simpson appeared to have been living on and off with the family in Room 301 at the Capital City Inn -- an emergency city-run shelter at 1850 New York Ave. NE -- for at least 10 months, according to Woods. But Woods said that Simpson had never been officially admitted to the motel and was not considered a member of the family under the government program from which the boys and their mother were receiving assistance.

The family had moved to the Capital City Inn after they were evicted from their apartment on D Street SE because they could not pay the rent. Although both boys needed a wheelchair, the family could afford to buy only one, police said.

A police source said that Simpson portrayed the slayings to police as mercy killings.

"After giving some thought to the children's health conditions and the circumstances under which they had to live, he made the decision he did," said the police source.

Several residents of the Capital City Inn who know Simpson described him as a "wonderful father" and a "loving person." They said that Simpson was driven to slaying the children and trying to kill himself because of his troubled life as a homeless man trying to provide for two handicapped boys.

Simpson had complained that the children's mother abused drugs and was not often at the shelter, the residents said.

Police said Simpson told them that the mother, Vinita Barnes, 32, frequently went out at night to use drugs, and he was often left to care for the boys.

"I don't condone what the man did by any means, but Stan's back was against the wall," said a man who lived two doors down from Simpson and asked not to be identified. "He couldn't take it anymore. He saw no way out."

"It's a real sad situation," said a woman who lived next door to Several residents of the shelter said they were under tremendous stress.

Simpson. "He was crying out for help."

Shortly after midnight, Simpson called the shelter's rental office and told a security officer that "he had stabbed his two kids," according to a police affidavit. He said that the children were locked in the room and security officers would have to force the door open, the affidavit said.

The guard rushed to Room 301 and forced the door open, finding the children stabbed and lying across a blood-soaked bed, according to police. One was stabbed once, and the other had been stabbed four times. Simpson, who was also lying across the bed, was suffering from stab wounds to his chest.

A police officer, who arrived shortly afterward, asked Simpson if he had stabbed the children. Simpson indicated by nodding his head up and down several times that he had stabbed the boys, the police affidavit said.

The children were taken to Children's Hospital where they were pronounced dead at 1:10 a.m. Simpson was taken to the Washington Hospital Center MedStar unit, where he was admitted in serious but stable condition. He is under police guard at the hospital and is being held on $50,000 bond on two counts of first-degree murder.

A preliminary hearing in the case has been set for Friday.

The children's mother was not in the room during the incident, and did not arrive home until several hours later, police said. She could not be reached yesterday.

Barnes and her two boys were living in the motel and receiving government payments under the Aid to Families with Dependent Children program.

Woods said that he and other agency officials had not obtained enough information to know whether motel workers or other government personnel were aware of Simpson's presence at the shelter.

Calling the triple stabbings "a terrible tragedy," Woods said he ordered Social Services Commissioner Marjorie Hall Ellis to investigate the government's involvement with the family and to issue a report by Jan. 18.

Several residents of the shelter, who have sent many petitions to city officials, said that they are under tremendous stress because of the run-down condition of the motel, lack of services, pervasiveness of drugs in the shelter and uncertainty of where they will be moved next.