William and Tracey Melton, the young Silver Spring couple who swallowed fatal doses of cyanide while being sentenced on a drug charge in a Montgomery County courtroom, had attempted to kill themselves at least once before the apparent suicide pact was carried out in public Friday morning.

According to friends of the couple who asked not to be identified, both "Doug," as he was called, and Tracey had been in deep depressions in the month before they finally took their lives on the day of sentencing.

Doug Melton recently told one longtime friend that he had been upset by a public portrayal of him and his wife as "drug-crazed addicts" after their arrest last March. He was also said to be disturbed by the court's handling of the case and the possibility of spending time in jail just as the couple had discovered Christianity and had begun to change their life style.

The friend recalled that Melton said he had been so depressed and confused that in the month before the sentencing he had tried to kill himself with an overdose of sleeping pills. Tracey, he told the friend, had slashed her wrist in a similarly unsuccessful suicide attempt.

"They were both really depressed after they got busted," the friend said. "They felt totally degraded by the whole situation. It got to the point where they couldn't handle it. Doug said that if he had to go to jail he would kill himself. He felt they would have a better chance in the next life."

While Doug Melton was revealing his life-threatening thoughts to close friends, however, legal and medical authorities were given few hints of their suicidal moods. The presentencing reports filed by Montgomery County prosecutors did not include psychological testing of the couple. Their family doctor, Robert Millman, said he had been prescribing sedatives for the Meltons in recent weeks and knew they were "afraid and upset," but had never heard the couple talk about suicide.

The tragic ending for Doug and Tracey Melton finally came Friday morning in Rockville, as Doug sat waiting for his sentence from Circuit Court Judge Stanley B. Frosh. Tracey, his wife of five months, was sitting behind him in the courtroom audience. As Frosh was preparing to sentence the 27-year-old Melton to a three-month term in a prerelease center -- not the jail that the defendant had so dreaded -- Melton reached into his suit pocket, popped a white capsule into his month, and after drinking some water, slumped in his chair.

His wife, who was waiting her turn to be sentenced, immediately approached from her seat, patted her husband on the hand and then popped another capsule into her mouth. Within minutes, both were dead.

"It happened so quickly, we didn't have a chance to explain to him [Doug Melton] what the judge was saying," said Melton's attorney, Maurice Beggiani. "Who knows what went on in the mind of Doug Melton."

According to sources, Judge Frosh had not been informed that the Meltons had suicidal tendencies and had decided to sentence them to the prerelease center, rather than give them probation as the prosecutor had recommended, because he was not convinced that they had put their lives in order after the arrest. Frosh was in the process of telling Doug Melton that he needed to spend some time in a controlled environment when the double suicides occurred.

The tragic odyssey of Doug and Tracey Melton started last winter when the couple, then unmarried and alienated from their two sets of parents, began living in a rented van.

Their life style was dominated by drugs and alcohol and last March it led to a confrontation with Montgomery County police. The police had responded to a complaint by some hitchhikers of loud noises -- possibly screams -- emerging from a van in an isolated church parking lot. When the police responded they heard screams and found Doug Melton with red paint on his forehead and a red rope around his neck. The words, "Satan Be Banished, Burn in Hell," were scrawled on his face.

During their investigation, police found marijuana, cocaine and a 6-foot African spear in the van. The couple, who insisted at the time that they were merely playing, were arrested and charged with drug possession and resisting arrest. The story of their arrest was major news for the county's local newspapers and Doug Melton's name and picture dominated the front page.

Their depression and conversion to Christianity began at that time. Despite testimony by friends that the two had changed, found religion and straightened out, both were convicted of charges in August. Two months before the trial they were married.

According to Millman, their doctor, Doug Melton came to see him after the arrest with his wife-to-be. He had cut his hair and shaved and "talked a lot about religion and Christianity and about using one's psychic ability to control one's destiny."

The couple's longtime friend said, "They really changed after they were busted; they became very religious and into God. They quit drugs."

They joined Wheaton's Halpine Baptist Church, got married and settled into an apartment, giving up the van and the pup tent in which they had lived on a neighbor's lawn after Melton's family had kicked him out of the family house.

The trial in August was difficult for the couple, friends recalled. Dr. Millman remembered Melton telling him that he felt the police and courts were not treating them fairly. "He said he had found Christ and he couldn't understand why the courts were giving him such a hard time. He said the police had lied."

"Doug was an almost antisocial guy. He just didn't like to be controlled and I think he saw what went on around him as control," Millman said. Tracey Melton, he said, "was like a puppy trailing along behind him. She agreed with what he said." Millman prescribed sedatives for the couple, which he said he did not believe they abused. "The refills came in at the right times."

On the day of the Meltons' sentencing before Judge Frosh, a bright, sunny Friday, Beggiani, their attorney, told them "there would be no incarceration. They would not go to jail. I told them the recommendation was for probation. They appeared to be well-adjusted to that."

The whole intent was to salvage these two young people's lives. The tragedy, Beggiani said, "was that it was too late to undo the damage."