A man who a Maryland state psychiatrist said was insane when he strangled an Oxon Hill woman was convicted of rape and first-degree murder and sentenced to life plus 30 years in prison yesterday by Prince George's County Circuit Judge Vincent J. Femia.

The man, Charles T. Franklin, 23, had pleaded not guilty by reason of insanity, and his attorney, Gary Ward of the public defender's office, told the judge his decision was "totally ridiculous." The defender's office said the verdict will be appealed.

In convicting Franklin, the judge said that while he was convinced the defendant has a mental disorder, "I totally disagree with the medical staff as to whether he appreciated the criminality of his actions . . . He knew he killed somebody and he knew what that meant."

According to testimony at Franklin's trial, which was held without a jury, he went to the apartment of Imelda Belisario Griarte, a 30-year-old medical technician, about 11:30 a.m. on Oct. 29, 1981, as she was preparing a birthday lunch for her 3-year-old daughter Wendy. Also in the apartment were Griarte's nephews Robert, 3, and Michael Leyva, 4.

Franklin raped Griarte at knifepoint, according to testimony, and put the girl in one closet and the boys in another before strangling the woman with an electrical cord.

On Tuesday, Robert (Bobby) Leyva, now 6, testified that the "bad man" who killed his aunt had worn a brown sweater, gray pants and tennis shoes. A neighbor, Tyrone Reid, testified he saw Franklin outside the apartment about an hour before the slaying wearing clothes of that description.

Franklin was arrested five days after the slaying, and homicide detectives testified that before being questioned he volunteered information that only the killer would have known. Detective Frank Gayle also testified that Franklin told him he had a "license to kill women."

Dr. Neil Blumberg, a psychiatrist at Clifton T. Perkins State Hospital, testified that Franklin suffers from schizophrenia and was insane at the time of the slaying. Prosecutor Robert Harvey argued that although the killing was bizarre, Franklin had some understanding of his actions.

In delivering his guilty verdict, Judge Femia said the fact that Franklin hid the children in the closets and threw away his shoes after the slaying indicated that he knew that what he had done was wrong.

Chief Prince George's Public Defender James Kenkel said later, "The finding of sanity . . . flies in the face of the state's own doctors . . . It is completely unsupported by any evidence." He said the case will be taken to the Maryland Court of Special Appeals.