The leaders of five North African nations Friday signed a treaty creating a common market and joining their countries in a union to compete with a united Europe.

The chiefs of state of Morocco, Algeria, Tunisia, Libya and Mauritania signed the document creating the "Union of the Arab Great Maghreb" in Marrakech City Hall at the end of a three-day summit."Maghreb" is the Arab word for "west" and is generally used to designate the Arab countries west of Egypt.

Libyan leader Moammar Gadhafi's last-minute proposal to expand the treaty to include Sudan, Chad, Mali and Niger was quietly dropped. Instead, the leaders inserted a line in the text leaving the treaty open to include "other Arab or African countries" at a later date.

The treaty would not have been possible without the recent reconciliation of Morocco's King Hassan II and Algeria's Chadli Bendjedid. The two countries had been on the brink of war for 15 years over Algeria's support for the Polisario guerrilla movement in the Moroccan-annexed Western Sahara. Morocco claims the former Spanish territory.

With U.N. help, the quarrel was resolved.

Immediately after the signing ceremony, the leaders went to the 1,000-year-old Koutoubia Mosque to pray.

The main body of the union is a council made up of the five chiefs of state. It will meet at least once a year to make decisions and set policy on a variety of economic issues. All decisions must be reached unanimously with any single nation having the right to veto.

A commission of prime ministers and foreign ministers will handle day-to-day affairs.

The goal is for individuals and goods to be able someday to move freely through the 2-million-square-mile North African region. In addition, trade agreements with foreign states or groups of states will be negotiated jointly.

The leaders also plan to institute a single identity card for all citizens of the new union.

The Arab leaders found motivation for their treaty in the European Economic Community's plans for a Europe without borders. Under a plan by the 12-member EEC, the arrangement would be in place after 1992 and would permit the free flow of goods and people throughout Europe.