The speaker of Lebanon's parliament postponed for four days tonight the presidential election that had been scheduled for Thursday, following a call by Moslem leaders for a boycott of the session.

Speaker Kamel Assad cited the "deteriorating security situation" for the delay, which he called after fighting broke out between leftist factions near the Villa Mansour, the Lebanese parliament building here. He reset the meeting for Monday and moved it to a Beirut military barracks.

But political analysts said they believed today's violence was a pretext for the delay, which they attributed to growing Moslem opposition to the early election. Moslem opponents have charged that Assad called an early meeting to pressure the parliament into giving the presidency to a Lebanese Christian leader who has close ties to Israel.

The Moslem group, led by former prime minister Saeb Salam, who has been a key intermediary in the peace negotiations for the withdrawal of Palestinian guerrillas from Beirut, met for several hours today before deciding to attempt to prevent the 62-vote quorum needed for the election to proceed.

The target of the boycott effort is Bashir Gemayel, the 34-year-old commander of the Christian Phalangist Party militia. To date, Gemayel, a leader of Christian forces in the bloody 1975-76 civil war, is the only declared candidate for the presidency.

Political analysts said tonight that it was unclear whether the Christian militia leader and his allies could get the necessary votes in the 92-member parliament by next Monday. If there is no quorum, Assad will be forced to set a later date, which would give Gemayel's opponents time to search for an alternative candidate acceptable to the many factions that make up the legislative body.

In calling for deputies to boycott the parliament, Salam was joined by Druze leader Walid Jumblatt, former prime minister Takieddin Sohl, and Nabih Berri, leader of the Shiite Moslem militia Amal.

Sources close to Salam said they expected the vote would be close and that the parliament seemed split almost evenly on the issue.

The Phalangist radio claimed that 49 lawmakers favored the session, and that 13 or 14 others also would go along, producing enough votes for a quorum.

The postponement was called after a brief shootout today near the parliament building between the Lebanese Army and Moslem militiamen after Israeli forces withdrew 200 yards from the area, Radio Lebanon reported. No reason was reported for the outbreak of fighting, which began after the Army took up positions around the building following the Israeli pullback.

There were unconfirmed reports tonight that the militiamen had warned that they would open fire again Thursday if the parliament attempted to meet.

Washington Post correspondent Leon Dash added the following from East Beirut:

A two-thirds majority of the deputies is needed to elect a president on the first ballot, but after that a candidate can win on a second ballot by a simple majority. Gemayel's Phalangist Party officials claim that they have more than the needed majority.

If the deputies do not elect Gemayel, both sides will be forced to turn to a compromise candidate such as former president Camille Chamoun, 82, who is ostensibly a Gemayel ally although relations between the two are said to be lukewarm. The electioneering and bargaining could go on until September, the absolute constitutional limit for electing a new president without a parliamentary amendment.

Despite his militant background, Gemayel has developed substantial support among Lebanon's Shiite Moslems, who, like Gemayel, want the Palestine Liberation Organization out of Lebanon. The Shiites also want a strong central government, which they believe Gemayel will provide.

Gemayel has also made an effort to at least neutralize public hostility to his candidacy from neighboring Moslem Syria. His intellectual political adviser, the highly respected Karim Pakradouni, traveled to Damascus Monday for a long session with Syrian Foreign Minister Abdul Halim Khaddam.

Israeli officials have denied playing any role in the elections, but some Lebanese Moslem leaders believe the Israelis are pushing for an early election to install a president acceptable to Israel before its forces withdraw from the city.