The red, white and black flag of Egypt was unfurled over the northern and eastern stretches of the Sinai today for the first time in 15 years, marking the end of Israel's occupation of the peninsula and the beginning of a new era in Israeli-Egyptian relations.

In a simple but emotional 30-minute ceremony here, the Egyptian governor of North Sinai, Youssef Abu Taleb, raised the flag as a small crowd of local people and federal dignitaries sang Egypt's national anthem and shouted, "Long live Egypt, long live Egypt."

"Thanks be to God for the return of this precious part of our land to mother Egypt," Taleb said in a brief speech. "I feel that I am not alone. With us are the spirits of the martyrs and heroes and foremost Anwar Sadat, our late leader, who gave his life for this moment. It was his decision of war and then his decision of peace that made this moment possible."

Taleb was referring to the slain president's decision to launch the last war against Israel in October 1973 and his historic trip to Jerusalem in November 1977 to make peace with Israel.

While the flag was being hoisted here in Rafah and in Sharm el-Sheikh in the far southern Sinai, President Hosni Mubarak was laying a wreath at Sadat's burial place at the tomb of the unknown soldier in a Cairo suburb near where he was assassinated last October by Moslem extremists.

Later, Mubarak participated in a joint Israeli-Egyptian telecast, reaffirming once again Egypt's commitment to peace with Israel. He hailed the Israeli's response to the "historic and courageous peace initiative" of president Sadat, and said it expressed "the will of every Egyptian" and had culminated in peace.

Mubarak gave special thanks to the "historic role" of former president Carter in helping to arrange the peace treaty between Egypt and Israel.

"Egypt has to double its efforts to safeguard the peace process and open new channels of communication and exchange and assure future generations of a better tomorrow," he said.

Egypt, he said, had lost 100,000 lives in four wars with Israel and spent more than $100 billion in the wars.

"The Egyptian people are determined to make the October war the last one in the area," he said.

Mubarak had ordered low-key celebrations of the final Israeli withdrawal out of sensitivity for Israel's feelings at the loss of the conquered land and a number of settlements in the northern Sinai.

Evidence of the agony of that withdrawal could still be seen as the flag-raising ceremony near here took place. An Israeli convoy of two jeeps and a truck passed through the assembled crowds carrying a die-hard Israeli settler who had apparently escaped from nearby Yamit, the last Israeli settlement to be dismantled by the Army after weeks of strong opposition from about 2,000 Israelis.

An hour and a half before the ceremony began, at 1:30 p.m. local time, an Israeli helicopter landed alongside the road outside the village of Sheikh Suiad, a few miles west of Rafah. Those aboard reportedly were looking for 10 to 12 other settlers who were still unaccounted for and apparently hiding in and around Yamit.

Several Israeli officers attended the ceremony and two Israeli Kfir jets flew high overhead. But otherwise, the Israeli presence so forcefully felt for 15 years was hardly in evidence.

Banners written in Arabic welcoming the incoming Egyptian authorities were everywhere and the most striking residue of the Israeli presence along the road were tomato, melon and cucumber plots of the ultranationalists involved in the antiwithdrawal movement.

Under the terms of the Egyptian-Israeli peace treaty signed in Washington three years ago, Israel was to withdraw from the final portion of the Sinai no later than midnight tonight.

In Washington, the White House issued a statement calling the withdrawal "the beginning of a new era in the peaceful relations between Israel and Egypt." The statement said President Reagan is determined to continue the Camp David peace process "with renewed vigor and dedication."

A White House spokesman said Reagan telephoned Mubarak and Begin this afternoon and expressed his personal admiration to both men for their statesmanship and the risks they have taken to advance peace in the Middle East.

An Israeli officer at Rafah, asked how it felt to be leaving after such a long occupation of the land, reflected a moment and then replied in French with a smile, "Comme ci, comme ca."

Yamit, a few miles off the highway on the coast, was off-limits to reporters today.

The raising of the Egyptian flag took place at the grounds of the new border post Egypt is building on the main coastal road outside Rafah, about 200 yards from the old 1906 international boundary between Egypt and what is now the Israeli-occupied Gaza Strip.

Most of the crowd, a mixture of Palestinians and Egyptians, came from Rafah and El Arish, the Sinai's main city and capital 27 miles to the west.

Among the main items of interest to residents returning to Egyptian rule were free issues of the Cairo newspapers being delivered for the first time in many years.

Much of North Sinai's Bedouin population seemed to have turned out for the occasion. Women dressed in black robes embroidered in red, orange and blue needlework and similarly colored veils ululated in small groups along the road while the men clapped their hands high in the air and shouted "Long live Egypt."

At one point the driver of a yellow taxi could be seen taking his Israeli license plates off and throwing them in the trunk. "From today, everything is Egyptian," he shouted to passing reporters.