In his cell in the Fairfax County jail, 24-year-old Fonzie Lankford banged his head against the floor and wall and cried out for his brother.

Once, accroding to a deputy sheriff's report, he tried to eat his throat sprayer, which he needs to deal with his severe case of asthma.

Fozie Lankford is mentally retarded. Tests show he has an IQ of 55, in the bottom 3 per cent of the population.

No one, most especially his jailers, wanted to keep Lankford in jail. But no institution wanted to take a mentally retarded person who, like Lankford, has been arrested for arson. Lankford was jailed in Fairfax from April to June and following a period of evaluation at Central State Hospital in Petersburg, Va., was returned to the jail last month.

After months of legal maneuverings that always came to a dead end, Lankford apparently is going to get the institutional help all the experts agree he needs.

The details of the solution were worked out yesterday in Fairfax General District Court, where Lanford pleaded guilty to three arson misdemeanors (reduced from felonies by the Commonwealth's Attorney's Office). Judge Lewis H. Griffith sentenced Lankford to a year in jail, but suspended the sentence and ordered the defendant to spend that period at Western State Hospital in Staunton.

Western State was initially proacting mental health commissioner, who became involved in the Lankford case. The hospital indicated it would be willing to accept Lankford in a special unit it has.

But it was only by pleading guilty - something his attorney had earlier doubted he was capable of doing - that Lankford will be assured of long-term help at Western State.

Lankford's case was remarkably similar to another one, involving 19-year-old Wayne Stotler, who was jailed in Fairfax on arson charges about the same time last spring because no institution would accept him. Shortly after Stotler's case was publicized, he was accepted by the Lynchburg Training School.

According to officials familiar with both cases, Lankford's placement was more difficult because the defendant was arrested for setting fires to a dwelling - the houses trailer where his mother and stepfather lived. Stotler had been arrested for setting fires in open fields.

According to officials, the institutions were fearful that Lankford might set fires in their quarters, too.

After yesterday's hearing before Judge Griffith, Lankford's court-appointed attorney, David M. Hill, said, "We've cornered the state into the position where they have to take him."

While Hill said he was glad Lankford would not have to face an uncertain future behind jail bars, he added, "This is the saddest case I have ever had to deal with . . . They've got a whole lifetime of neglect to try to make-up for."

In a report made available to Judge Griffith, Dr. J Browning Hoffman, director of the forensic psychiatry clinic at the Unversity of Virginia's School of Medicine, said, "(The clinic) does not know of any existing facility in Virginia which offers the unique combination of psychological and medical benefits seemingly required by Mr. Lankford at this time."

Besides being mentally retarded, Lankford suffers segvere attacks of asthma.

Defense attorney Hill is hopeful that Lankford, after extended treatment at Western State, will be improved enough to live in a halfway house.