For Anwar Sadat, the signing of a peace treaty with Israel is the culmination of a policy that he has pursued through triumph and adversity, masterstroke and blunder, acclaim and condemnation almost from the day he took office as president of Egypt.

He publicly proclaimed his intention to seek almost from the beginning, but few heeded his words. Sadat, an obscure, almost clownish figure in his years as a faithful lackey of Gamal Abdel Nasser, was hardly credible as leader of Egypt, let alone as a word figure who would change the course of history.

It is not yet certain that Sadat can lead his fellow Arabs into peace as he led them into war in 1973. But even if he falls short of that, he has altered irreversibly the life of his own country and the course of events in the Middle East.

It seems safe to say that not since the Sherif Hussein of Mecca cast the Arab lot with the Allies against the Turks in World War I, ending four centuries of Ottoman dominion over the Arab world, has any Arab leader taken a leap of such historic implications.

Hussein's action had a bitter aftermath as the Arabs felt themselves betrayed by the British and French after the war.

Sadat has no guarantee of any happier outcome for his bold acceptance of Israel into the company of Middle East nations and his strategic alliance with the United States. But he has already earned himself a place in the annals of national leaders who combine vision, cunning, courage and luck to transform not only their own countries but whole regions of the world.

To understand what Sadat has done it is only necessary to see where he and Egypt were when he became president upon the death of Nasser on Sept. 28, 1970.

Egypt was a prostrate and humiliated country, still reeling from the rout of its armies by Israel in 1967 and a military debacle in Yemen, in thrall economically and politically to the Soviet Union, sustained mostly by the force of Nasser's personally. Nasser, exhausted by his efforts to halt the "Black September" fighting between Jordan and the Palestinian guerrillas, died suddenly, leaving behind a country that was politically inert after years of police-state repression.

The road from that point to a peace treaty with Israel signed in Washington by the confident leader of a resurgent country was long and hazardous and Sadat did not navigate it unaided, but he signed from the beginning that he was prepared to try.

He had been president only four months when he startled the Israelis and the rest of the Arabs by saying he was prepared to recognize Israel and make peace with it on certain conditions. He offered to reopen the Suez Canal and enter into a partial settlement in exchange for a pullback of Israeli troops from the canal to the Sinai passes. In the light of subsequent events that hardly seems breathtaking, but it created a sensation at the time.

Then as now, Sadat's policy was rooted not in any esteem for Israel, which was Egypt's enemy, an arrogant, alien presence on Arab land, but in a pragmatic assessment of Egypt's needs and capabilities. Sadat knew that Israel as a nation was there to stay, since both the United States and the Soviet Union wanted it that way, and so Egypt would have to come to terms with it.

At that time, however, Sadat was the weak president of a defeated country, challenged for power by a pro-Soviet clique of Nasser's cronies. Lacking power in Egypt, he lacked credibility internationally, and his olive branch quickly withered.

Sadat often talks now as if he had some grand design, some comprehensive strategy that would lead him to the peace agreement and to a new strategic partnership with the United States. But while his objective may have been consistent, he has had to shift and improvise and adjust his tactics year after year as unforeseeable events complicated his quest-the cutoff of Soviet arms, the downfall of Richard Nixon, civil war in Lebanon, the election of Menachem Begin as prime minister of Israel, the revolution in Iran.

Moreover, as Sadat admits, he would not have succeeded if his inclination to bring Egypt back into the Western orbit and appeal to the United States had not been met by a determined, affirmative response from Jimmy Carter.

Now Sadat has ended Egypt's long, debilitating struggle against Israel, gained Israeli commitment to full evacuation of the Sinai and some form of self-government for the Palestinians, and risen to international acclaim capped by the Nobel Peace Prize.

But among his fellow Arabs, to whom he was a hero after his armies stood up to Israel, he is viewed with suspicion, sorrow, anger and outright enmity for making a deal with Israel that most of them would not-could not-have accepted.

In Sadat's view, his approach is the only one that works, and the other Arabs will either come around to it or be left empty-handed by history. It may take years to find out if he is right, but meanwhile even his enemies concede that he is a bold and innovative gambler who has the courage of his convictions and a talent for assessing the strength of his opposition.

In retrospect, the broad outlines of what Sadat has done are recognizable and make sense in their own context: In order to negoitate with Israel, he had to restore Egyptian self-esteem and break the Isareli overconfidence that resulted from the 1967 war. To do that, he had to wage a successful military compaign against Israel. And to do that, he had to rid himself of the Soviet advisers who were, in effect, running his armed forces and trying to restrain him.

Once all that was accomplished, he had to demonstrate his sincerity to mistrustful Israelis and break through or circumvent their faith in the concept of the "secure borders" to protect themselves from marauding Arabs. He also had to cultivate his relations with Washington while making the Americans nervous by breaking out of the Geneva-oriented traditional diplomacy that he viewed as sterile.

It seems a tidy pattern now, but Sadat often improvised along the way and the evolution of his policy was often confusing, dangerous and counterproductive. In the end it took an element that could scarcely have been imagined when Sadat became president-the direct, forceful intervention of an American president willing to deal with Israel in a new way-to bring Sadat home safely.

The Arab world is largely dominated by rulers who stay in power through caution, but Sadat has gone the opposite way. He got where he is through a series of bold, innovative strokes, each of which astonished outsiders who continued to underestimate him.

He began by defying CIA and British intelligence predictions that he would not last six months. He overcame his pro-Soviet rivals in a power struggle now known as the "corrective revolution."

Then to placate the Soviets he signed a treaty of friendship with the Soviet Union, but actually the relationship between Cairo and Moscow was rapidly deteriorating behind the scences. He discovered that promised weapons were not delivered, that Egyptian officers were checking with their Soviet advisers before carrying out orders and that the Soviets were even putting military bases in Egypt off-limits to Egyptian personnel.

Sadat had proclaimed 1971 as the "year of decision" in the Middle East and he was ridiculed when nothing happened. In his memoirs, he says he wanted to go to war that October but could not because promised Soviet weapons were diverted to India, then at war with Pakistan. In fact, the Egyptian army was nowhere near ready to strike at Israel.

Sadat has taken aback when, the following May, the Soviet Union and the United States jointly called for a military "relaxation" in the Middle East. To the Arabs that means perpetual Israeli superiority and perpetual occupation of the territories Israel captured in 1967.

Three months later, to regain control of policy and of his army, Sadat threw out all 15,000 Soviet military advisers-a move that was then thought to make it impossible for Egypt to go to war but that scholars now agree was the decisive step that gave Sadat freedom to launch his surprise attack of October 1973.

Sadat later wrote, and said repeatedly, that the war "exploded, forever the myth of an invincible Israel." Whoever won the war tactically, Egypt won it psychologically, and that phrase has become part of the language here.

The diplomatic fallout from that war opened the way to the peace treaty and to Sadat's split with the other Arabs. It also led to the establishment of Sadat's close ties with Washington.

Convinced that the Soviets were unreliable friends and more of a hindrance than a help, Sadat was receptive when former secretary of state Henry Kissinger undertook his shuttle diplomacy seeking disengagement agreements and the creation of a buffer zone in the Sinai. Diplomatic relations were restored with the United States early in 1974 and President Nixon was given a rousing welcome here just before his resignation.

Sadat later wrote that his first meeting with Kissinger "marked the beginning of a relationship of mutual understanding with the United States culminating and crystallizing in what we came to describe as a peace process. Together we started that process and the United States still supports our joint efforts to this day."

Even with the involvement of the United States, which Sadat often said held "99 percent of the cards in the Middle East," the peace process did not move along swiftly or smoothly. Sadat continued to jog it along with a series of startling maneuvers.

Having defied the criticism of other Arabs by signing the Sinai disengagement agreements, he reopened the Suez Canal to demonstrate his commitment to peace and economic redevelopment. He bombed Libya and sent military aid to Zaire to show his commitment to stability in Africa. Attempting to demonstrate his flexibility on the Palestinian issue, he said that any Palestinian state created in the occupied territories should be constitutionally linked with Jordan, a break with Arab policy that drew little response.

Then in 1977, convinced that the Geneva conference for which the Americans were pressing, could not be convened and that even if it were it would produce nothing, he administered the biggest shock of all by going to Jerusalem.

He did so, he later said, because he felt there was one obstacle to peace that could not be overcome by diplomatic nuance-the "psychological barrier" between Israel and the Arabs, "that huge wall of suspicion, fear, hate and misunderstanding" between them.

It is now part of the inconography of Egypt that just as the 1973 war destroyed they myth of Israeli invincibility, Sadat's stunning trip to Jerusalem brought down that psychological barrier. CAPTION: Picture, Arriving at Andrews Air Force Base for Monday's treaty ceremony, Egyptian President Sadat tells Vice President Mondale he is here in "holy pursuit of peace." AP