Soviet authorities today officially accused Robert C. Toth, Moscow correspondent of the Los Angeles Times, of collecting "political and military secrets" and ordered him to undergo interrogation at a prison of the KGB, the security police.

After four hours of questioning today Toth was told to come back in the morning. The correspondent, who was planning to depart from the Soviet Union Friday after a three-year tour here, was also told that he may not leave pending the outcome of the KGB investigation.

The Soviet action is another sharp escalation of the Kremlin's current drive to portray Western journalists in Moscow - especially Americans - as subversive. While a number of correspondents have been expelled in past years and a great many have been harassed, the action against Toth appears to be unprecedentedly ominous.

While the Soviets have frequently expelled correspondents whose work they condemned, none has been questioned undersuch threatening conditions as to where he had been obtaining the information for his articles.

The move is also clearly meant as a challenge to President Carter on the eve of a conference in Belgrade where diplomats are to set terms for a review of compliance with the two-year-old Helsinki accords on European security.

Carter has said that the United States will show where the Soviet Union has failed to live up to the human-rights aspects of those accords. Moscow has countered that American concern for dissidents is merly a cover for espionage.

Toth was seized by police on a downtown street Saturday morning moments after an acquaintance, a Soviet scientist, handed him a paper on parapsychology, the study of such phenomena as extrasensoty percention and mental telepathy. The scientist, Valery Petukvo, had called Toth earlier saying he needed to see him urgently. After three hours in police custody during which officials said that the Petukvo paper contained state secrets Toth was released.

Today when U.S. embassy officials went to the Foreign Ministry to protest the detention, they were handed a statement that alleged that "over a period of time" Toth had been engaged "in activities incompatible with his journalistic status . . . the collection of secret information of a political and military nature."

The document ordered Toth to remain in Moscow and said he would be summoned "for interrogation by the investigatory organs." Almost immediately a formal summons was delivered to Toth at his apartment telling him to appear in the early afternoon at Lefortovo Prison, a KGB facility.

[In a statement realeased in Los Angeles Times is shocked and dismayed by the Soviet decision to prohibit Mr. Toth from leaving the Soviet Union and to subject him to accusations and interrogation in connection with his legitimate journalistic activities. We do not understand why Soviet authorities have undertaken the intimidation of Mr. Toth and we are seeking both the reasons for and the termination of this decision."]

Toth, 48, an experienced correspondent who worked for the Los Angeles Times in London and Washington before coming here, termed the allegations "ludicrous." But he made no attempt to challenge the KGB order to report to Lefortovo.

He was accompanied there by a U.S. consular official, Larry Napper, who had hoped to be present during the questioning. Napper was turned back, however, and had to wait along with Toth's wife, Paula, in a corridor.

An obviously weary Toth told reporters that the interrogation had concerned only the Saturday incident and his contact with Petukov. The correspondent met the scientist at a party for a departing Jewish scientist about six months ago. Petukov said he was a laboratory chief at the Moscow Institute of Medical-Biological Preparations and interested in parapsychology.

Toth, who worked for a number of years as a science writer, has written extensively here on Soviet science. He said he had asked his interrogator, KGB Maj. O.A. Dobrovolsky, today why a paper on a subject such as parapsychology should be considered secret.

"The impression I had" from Dobrovolsky's answer, Toth said, "was that any information about science not officially released is secret."

Soviet press attacks on American journalists linking them to American intelligence agencies began about a year ago and lasted six weeks. They resumed again - along with similar allegations against several American diplomats - when President Carter's rhetoric on human rights emerged as a major new irritant in U.S.-Soviet relations. Toth, however, had never been named.

By intimidating correspondents the Soviets apparently hope to deter them from writing about controversial or sensitive subjects and also to discourage their Russian friends and contacts from talking with them.

Toth's meeting on the street with Petukov was a routine example of how a reporter here meets with a source, since it is difficult for Soviets to gain access to foreigners' apartments. Correspondents are likely to think twice before such encounters in the future.

More important, since the Foreign Ministry statement today speaks of Toth' collecting "secret" information "over a period of time," it is possible that he will be held to account for material in past stories.

Mrs. Toth said she and the couple's three children would stay in Moscow while the investigation continues.