Correction Appended

CAIRO, May 4— Israel and the P.L.O. signed an agreement today that formally begins Israel's withdrawal from the Gaza Strip and the Jericho area of the West Bank -- lands occupied for 27 years -- and grants Palestinians a measure of self-government for the first time, though not sovereignty.

The accord, which follows up the agreement in principle signed in September in Washington, opens a new chapter in the Middle East. It provides for the possibility of Palestinian control of an area whose occupation by Israel has been a focus of Arab anger for decades, and holds out the chance for reconciliation between Israeli and Palestinian.

But for any of that to happen, there will have to be further agreements between Israel and the Palestine Liberation Organization during the next five years. During that time the Palestinians will be tested to show that they can govern the limited areas now being given to them.

The World Bank and many countries, including the United States, are committed to helping the Palestinian authority, as it is called, to survive.

The ceremonies here were led by President Hosni Mubarak of Egypt, whose country has been the only Arab land to make peace with Israel, and were attended by many dignitaries. The agreement was signed by Prime Minister Yitzhak Rabin of Israel and Yasir Arafat, chairman of the P.L.O.

Until last summer's negotiations leading up to the White House signing in September, the Israelis and the P.L.O. had been bitter enemies; now they are united in defending their accord.

Mr. Arafat, whose name was once anathema to Israelis, described the accord as a "true beginning -- to complete the march of peace, guarantee the legitimate rights of the Palestinian people, and realize justice and equality." [ Excerpts from speeches and from the agreement are on pages A16 and A18. ]

But the ceremony faltered in a last-minute dispute over the boundaries of Jericho, and the Palestinian leader signed only after 35 awkward minutes of on- and off-stage negotiations with Mr. Mubarak and Secretary of State Warren Christopher.

After the heated consultations, Mr. Arafat added a handwritten note that the Jericho boundaries were still in dispute. Only then did he sign. Israel has offered a Jericho region of 24 square miles; the Palestinians have asked for 42 square miles.

Mr. Rabin accepted the changes and added his signature, bringing relieved applause from 1,500 dignitaries and journalists gathered in a conference center on the edge of Cairo. Officials from both Israel and the P.L.O. said they did not believe that the map dispute and two other technical issues still unresolved would delay carrying out the accord.

"We witnessed, you witnessed, the world witnessed the tip of the iceberg of problems that we shall have to overcome in the implementation of even the first phase of the Declaration of Principles," Mr. Rabin told the audience at the Cairo Convention Center. Opposition on Both Sides

But there is strong opposition to the agreement within Israel, where the opposition Likud Party has been against the withdrawal, and among Palestinians, many of whom have sided with radical groups like Hamas that have opposed partial steps.

Mr. Rabin, who was the Chief of Staff in 1967, when Israel defeated Egypt, Jordan and Syria in a three-front war, said today: "There is an opposition on both sides to what we are doing today. And it will require a lot on both sides to make sure that we will succeed and achieve peaceful coexistence and, in addition to that coexistence, bring about a permanent solution."

The Israelis had planned to pull their last troops out of Gaza and Jericho within days of today's signing, but Mr. Rabin said today that Mr. Arafat had asked the Israelis to delay their total pullback for the 21 days allowed in the accord because the Palestinians were not ready to take over.

Up to 9,000 Palestinian police officers are to be assigned to Gaza and Jericho, and various self-government organs will be established, short of giving the Palestinian authority sovereignty over the region. The first contingent of the Palestinian police was supposed to arrive on Thursday.

Israeli troops are to remain at the Rafah border crossing and at Jewish settlements in the Gaza Strip, and Israel will be permitted to move troops into the self-rule areas "in the event of the outbreak of general hostilities or imminent threat of such hostilities."

The Palestinians will not be permitted to maintain embassies or consulates in other countries, but will be permitted to negotiate economic and cultural agreements. Israel will be responsible for Israeli settlements in the region and for overall security in the area. Emphasis on Jericho

Gaza, with about 800,000 people, is the more populous area, but has had little political importance. Israel has never considered annexing Gaza, and Egypt has shown no interest in taking it over again.

Jericho, on the other hand, which is near Jordan, is part of the West Bank that many Israelis have argued is part of historic Israeli lands of Judea and Samaria.

The Palestinians have regarded the Israeli withdrawal from Jericho as much more significant to their long-term political goal of a sovereign Palestinian state than the withdrawal from Gaza. In fact, Mr. Arafat is expected to make a brief symbolic visit to Jericho soon, certainly within a month, and eventually establish his home base there, moving from Tunis.

Faisal al-Husseini, the senior P.L.O. leader in the West Bank, said the accord provided "the first stage for a Palestinian state."

"I would hope that it would be a bigger first step," he said, "but it is the beginning."

In fact it marks the first time the Palestinians will be in charge of their own affairs in recent history. The Israelis, while permitting such autonomy, are still not enthusiastic about the idea of a Palestinian state. Interim Period of Five Years

The September accord provides for the initial phase of a five-year interim period of limited Palestinian self-rule, to start upon the Israeli withdrawal from Gaza and Jericho. Negotiations on the permanent status of the occupied territories are to begin as soon as possible, but no later than the beginning of the third year of the interim period.

Before World War I, the Arabs in the region were under Turkish Ottoman control, and between 1918 and 1948 they lived under British control in Palestine. In 1948, when the United Nations voted to set up separate Jewish and Arab states in Palestine, the Arab states invaded the new Jewish state of Israel, and the West Bank of the Jordan was taken over by Jordan. The Gaza Strip was under Egyptian administration.

In 1967, in the Six-Day War, Israel captured all of Sinai and the Gaza Strip from Egypt, the Golan Heights from Syria and the West Bank from Jordan. It annexed East Jerusalem, which had been part of the West Bank, uniting the city.

In March 1979, after the Camp David meeting the previous September between Prime Minister Menachem Begin of Israel, President Anwar el-Sadat of Egypt and President Jimmy Carter, Israel agreed to give back Sinai in return for peace with Egypt. Prisoners to Be Freed

As a good-faith gesture, Israel is committed to releasing 5,000 Palestinian prisoners in Israeli jails over the next five weeks. About 225 were released in Gaza today.

The agreement also gives Palestinians control over their internal political arrangements and daily affairs -- elections, tax collection and the passage and enforcement of legislation. There will be Palestinian banks and Palestinian courts. But a joint Israeli-Palestinian committee will have the power to review laws, and to block them if they are deemed harmful to Israeli interests.

On symbolic issues touching on sovereignty, the Palestinian authorities will be able to issue a travel document that will contain the word "passport." But Mr. Arafat will be called "chairman" of the Palestinian authority rather than "president." Expressions of Hope

But for all the lingering questions, many of them serious, about the details of the accord, officials at the ceremony today were upbeat.

"Negotiations do work; peace is possible," said Secretary Christopher, who also signed the document because the United States is a co-sponsor.

"We have not yet seen the end of contention in the Middle East, but we are changing the manner of contention. We are coming closer to the day when disputes that were once inflamed by the argument of force will now be settled by the force of argument."

"It's a historic day," said Mr. Rabin's spokesman, Gad Ben-Ari. "No question that today, after the signing, we are embarking on a new era, not without risks, not without concerns, not without butterflies in the stomach. But we feel a tremendous step has been achieved."

The hope was echoed by the Prime Minister Rabin. "We have hope, but we have much trepidation, that the two peoples could live on a tiny patch of land, each under their own fig tree, as the prophets said," Mr. Rabin declared.

He said that "at this stage I do not want to deal with the permanent solution," adding: "We do not accept the Palestinian goal of an independent Palestinian state between Israel and Jordan. We believe there is a separate Palestinian entity short of a state." Images of Pyramids

Mr. Rabin and Mr. Arafat signed the document, with six maps and addenda, on a stage at the conference center. The ceremony took place in front of a large polystyrene image of the Sphinx, the three Giza pyramids and figures of young women in pharaonic dress releasing doves.

International donors have pledged $2.4 billion over five years to help rebuild Gaza and Jericho.

"This is first time Palestinians will run a large community in what used to be the British mandate of Palestine," Mr. Rabin told reporters. "From our point of view, the main test is security. If there will be stability and security, there will be investment. If there will be no security in Gaza, or in the Jericho area, who will invest there?"

The agreement ends three decades of exile for Mr. Arafat, transforming him from a guerrilla leader who often lived in secrecy to a civil administrator.

The signing also seems to end the dreams of the many Israelis who had hoped to establish a greater Israel beyond the pre-1967 borders and who have vowed to disrupt the process. It has also angered the Islamic militant group Hamas, which opposes the peace plan. 'Many Are the Obstacles'

"Much work still lies before us," said Israel's Foreign Minister, Shimon Peres. "Many are the enemies and many are the obstacles that lie before us."

Mr. Rabin, who directed most of his remarks to his Israeli television audience, called the agreement "a very daring project."

"A hundred years of animosity have created hatred between us," Mr. Rabin said in Hebrew. "We have killed you, and you have killed us. Thousands of our graves, thousands of your graves are the painful signposts in your history and in our history."

"Today, you and we stretch out our hands to each other," he continued. "We begin a new count. The people of Israel hope that you will not disappoint us."

Mr. Rabin concluded with an impassioned call for reconciliation.

"In the alleys of Khan Yunis and in the streets of Ramat Gan, in the houses of Gaza, in the town square of Hadera, Rafiah and Afula," he said, "today there is a birth of a new reality. One hundred years of Palestinian-Israeli conflict can now be over. Millions of people look to us in the hope of leading normal lives."

Photos: Yasir Arafat caused an uproar in Cairo yesterday when he refused to sign part of the accord. Discussing the issue, which was resolved after 35 minutes of heated talks, were, from left, Foreign Minister Shimon Peres of Israel, Foreign Minister Andrei V. Kozyrev of Russia, Prime Minister Yitzhak Rabin of Israel, Foreign Minister Amr Moussa and President Hosni Mubarak of Egypt, and Mr. Arafat. (Agence France-Presse) (pg. A1); Against a backdrop that included a statue of Isis, the Egyptian goddess of fertility, Yasir Arafat, head of the P.L.O., signed an accord in Cairo yesterday giving Palestinians control of Jericho and the Gaza Strip. Assisting him was Rami Shaath, son of the P.L.O.'s chief negotiator, Nabil Shaath. (Associated Press) (pg. A16) Map of Israel shows land officially occupied by the nation with the signing of the Israeli-Palestinian accord. Also shown are boundaries of Jericho which remain in dispute. (pg. A16)