Less than two months ago, a criminal investigator turned an anti-corruption crusade into political magic and won a parliamentary seat with 86 percent of the vote.

Today, Telman Gdlyan is in trouble with the Supreme Court for jailing a scientist who died in prison. And the country's highest executive power said Saturday he is interfering with an investigation of alleged abuses of power.But Gdlyan's fellow investigator, Nikolai Ivanov, has charged the two are running into trouble because their investigations are making high-ranking officials squirm.

The controversy gripping Gdlyan is a lesson both in rapidly changing Soviet electoral politics and in President Mikhail S. Gorbachev's effort to make his country one ruled by law rather than personal dictate.

Gdlyan, a 49-year-old senior investigator with the prosecutor general's office, last year exposed a corruption scandal in the republic of Uzbekistan that brought him national attention.

An article on the scandal, written by Gdlyan and Ivanov and published in Ogonyok magazine, caused uproar at the Communist Party conference in June and turned the two into national heroes.

Gdlyan capitalized on his popularity in March congressional elections - the country's first multicandidate nationwide ballot in 70 years. Voters in Moscow's Tushinsky district swept him into office with 86.6 percent of the vote. The balloting was marked by a strong anti-establishment streak.

But in a statement published Saturday, the Presidium of the Supreme Soviet, the country's highest executive body, came down hard on Ivanov and Gdlyan.

The statement in the Communist Party daily Pravda accused the prosecutors of making provocative statements in meetings and in the media about alleged violations of law by Soviet leaders.

On May 7, the Supreme Court said it found systematic abuse in Gdlyan's handling of an investigation into prominent Estonian scientist, I.A. Hint. The 67-year-old scientist, who won the prestigious Lenin Prize, was convicted in 1983 of bribery, theft, and smuggling. He suffered from a cardiovascular illness and died in jail.