Thomas Franklin Smith III, 30, who was charged by Montgomery County police Friday with fatally shooting his estranged wife in Wheaton, had been found not guilty by reason of insanity in an earlier incident in which five police officers were injured, a search of court records in the county showed yesterday.

Three years ago, Smith was charged with intent to murder a police officer, the records show. His arrest Feb. 14, 1982, came after police responded to what they thought was a domestic dispute in Wheaton. They found Smith locked in his car, a Silver Spring taxi cab, threatening to slash his wrists.

Smith drove away, with police in pursuit, and by the time he was captured a half hour later, five police officers had been injured and three patrol cars damaged, records show.

On Dec. 6, 1982, Smith was found not guilty by reason of insanity, the court records said. And a few months later, on April 12, 1983, despite objections from the county state's attorney, Smith was released from Springfield Hospital Center in Sykesville, where he had been undergoing treatment "for a major mental disorder," records show.

In one letter dated Feb. 17, 1983, included in the court file, a Springfield Hospital Center physician, Dr. Robert J. Guziec, wrote: "It is my opinion that Mr. Smith no longer represents a danger to himself or to the person or property of others by reason of a mental disorder." No reasons were given for his opinion.

Hospital officials recommended that Smith be conditionally released to pursue an outpatient treatment program. He was directed to live with his sister in Silver Spring until he was able to live alone. He was told to report regularly to the Silver Spring Mental Health Clinic for medication and psychotherapy and to the Montgomery County Alcohol Clinic for treatment of alcoholism.

In a petition filed March 18, 1983, opposing the recommendation for Smith's conditional release, Richard E. Jordan, then an assistant state's attorney for Montgomery County, said the hospital recommendation "includes conditions that are so vague as to be tantamount to an unconditional release."

Less than a month later, on April 12, 1983, Circuit Court Judge John F. McAuliffe issued an order for Smith's release, based on the hospital recommendation. McAuliffe, who could not be reached for comment yesterday, has just been appointed to the Maryland Court of Appeals.

Last Friday, Smith called Montgomery County police from a pay telephone in Wheaton and told them that he had just shot his wife, according to Officer Phil Caswell.

Police found Pamela Lynn Smith, 27, who had been shot with a shotgun, on the ground outside an apartment at 11430 Amherst Ave. where she and the couple's 6-year-old daughter had been staying. She was rushed to the hospital, where she died about two hours later, Caswell said.

Smith was charged with murder and is being held without bond, officials said.