Rival Moslem and Christian governments threatened Lebanon with formal partition Friday after Parliament failed to elect a successor to President Amin Gemayel.

Gemayel, 45, ended his six-year term at midnight Thursday and handed power to his Christian army commander, Gen. Michel Aoun, appointing him prime minister of a six-man military Cabinet.The three Moslem officers named to serve in the caretaker government refused to take up their posts, and the country's Moslem majority vowed allegiance to incumbent acting Prime Minister Salim Hoss, a Sunni Moslem.

Lebanon, a tiny Mediterranean country of 4,036 square miles, has been plagued by sectarian strife since 1975. But this was the first time since independence from France in 1943 that Lebanon's population of 4 million has come close to formalizing the de facto partition between Christians and Moslems.

Daniel Simpson, the highest ranking U.S. diplomat in Lebanon, visted Hoss in west Beirut Friday but declined to tell reporters which government Washington would recognize.

After the meeting, Christian gunmen, apparently angered by his meeting with Hoss, stopped Simpson's car at a crossing linking east and west Beirut as he returned to his residence in the Christian sector, a police spokesman said on condition of anonymity. Simpson was later allowed to leave.

Both Hoss and Aoun summoned envoys of all five permanent member states of the U.N. Security Council - the United States, the Soviet Union, Britain, France and China - to meetings Friday and Saturday, apparently seeking recognition of their governments.

In Washington, State Department spokesman Charles Redman said a presidential election is needed "as soon as possible. We urge all parties to exercise maximum restraint."

Redman also declined to say which government Washington will recognize.

Parliament, its 76 surviving deputies deeply divided along sectarian lines, canceled a Friday morning session, undermining the third attempt in five weeks to elect a new president.

Parliament Speaker Hussein Husseini postponed the session "until a date that will be announced later," Parliament secretary Ihsan Abu Khalil announced.

Christian parliamentarians, who rejected candidacy of two pro-Syrian Christian presidential hopefuls, former President Suleiman Franjieh and parliamentary deputy Mikhail Daher, boycotted Parliament sessions Aug. 18 and on Thursday.

Aoun, 53, assumed power midnight Thursday at the presidential palace in suburban Baabda in the Christian heartland northeast of Beirut. He told reporters later: "We haven't come to impose martial law in Lebanon. My program is to arrange the speedy election of a new president."

Aoun's authority would cover only about 1 million Christians living in a 386-square-mile enclave in east Beirut and the hinterland to the northeast.

Husseini and Hoss described Gemayel's move as "illegal" and Hoss summoned his Cabinet to a meeting in west Beirut Saturday.

Expected to attend are Justice Minister Nabih Berri, a Shiite; Public Works Minister Walid Jumblatt, a Druse; and Abdullah Rassi, a Syrian-backed Greek Orthodox in Beirut's Moslem sector.

Jumblatt, who commands the Progressive Socialist Party militia, and Berri, who heads the Amal militia, said Aoun's appointment was tantamount to a "coup d'etat."