Not so many years ago, the voice of Mohammed Heikal was the voice of Egypt.

He was the Arab world's most prominent journalist for the better part of the two decades; but more than that, he was the friend and adviser of President Gamal Abdel Nasser. His weekly column in the newspaper Al Ahram was the outside world's window on that secretive regime.

Today, Heikal at 53 is an elegantly dressed, cigar-smoking symbol of how things have changed in Egypt.

For weeks the Cairo press, of which he was once the most influential figure, has been vilifying him and called for his arrest. The reason is that he opposes the domestic and international policies of Nasser's successor, Anwar Sadat, and says so in print - not in Egypt, where he was silenced three years ago, but in newspaper around the Arab world that still publish his columns.

He is being denounced here as a tool of the Soviet Union and a slanderer of his country. Banner headlines have asked why he is in custody. One article sought to link him, with an old minor scandal volving the acquisition of watches for sale in the state-run duty-free shops. To an outside observers, however, it appears that his real crime has been to say, persuasively things that Sadat does not want to hear.

Sadat denounced Heikal at length in early April, accusing him of opportunism that betrayed the national interest, but it still seems unlikely that he will actually be jailed.

Heikal looks prosperous and relaxed as he receives visitors in his insert elegant flat overlooking the Nile, and does not appear to feel threatened by what he calls the "smear campaign" against him. "It is degrading," he said, and has made his three sons unhappy, "attacking me over matters of opinion has made me a hero to the man in the street position I do not want."

In the power struggle that followed Nasser's death in 1970, Sadat imprisoned many of the rivals who claimed to be Nasser's legitimate heirs - always referred to here as the "centers of power - but when he fell out with Heikal he sought to neutralize him by brinking him to the government.

To arrest him now would be to throw off the last shreds of the tattered cloak of Nasserism that Sadat has sought, for political reasons, to keep across his shoulders.

But there is clearly an attempt under way to discredit Heikal's opinions. This campaign has made news in the Arab capitals where Beirut, Amman and Jerusalem, and he claims to be receiving telegrams of support from his readers.

In his recent articles, and in an interview on Hungarian television, Heikal has disputed Sadat's views on several vital issues confronting Egypt and the Arab world.

He argued against the diplomatic campaign, to which Sadat is committed, to negotiate for peace with Israel, asserting that the Arabs would be going into the talks in a position of relative weakness.

He opposed Sadat's break with the Soviet Union, saying that Sadat should have sought Soviet support to obtain a favorable peace settlement and that it was "immoral" to exclude the Russians from the peace initiative when Egypt had obtained so much from them when it wanted war.

"I object to anybody who says that the United States hold 99 per cent of the cards in the Middle East," Heikal said in a recent conversation, disparaging Sadat's favorite phrase. "It's unfair to us and it's unfair to the United States."

He argues that the United States alone cannot deliver a Middle East peace formula acceptable to the Arabs and that it was a mistake for Egypt to try to cut the Soviet Union out of the game.

Heikal has also challenged Sadat's claim that the Cairo food-price riots in January were the result of a Communist plot to bring down the government. He says they were a "genuine popular explosion" that should have been met with a "political response instead of a police response."

This view is widely held by independent analysts of the riots, but completely out of step with the official line here.

It was Heikal who built Al Ahram into the Arab world's best-known newspaper, and he notes with a certain satisfaction that its circulation and reputation have declined since Sadat dismissed him from the editorship three years ago.

But he still refers to it as "my newspaper." It was his prominence there that enabled him to become a friend and colleague of powerful and influential people all over the world, and now, chatting with visitors in his softly quiet, paneled, book-lined apartment, insulated from the squalor of Cairo below, he admits that it pains him to be denounced in his own paper as a "socialist millionaire."