Lebanese President Amin Gemayel has defied calls for his resignation and, in his first public comment since opposition by his Christian allies stalled a Syrian-mediated accord, pledged to hold on to the presidency.

Discussing a political impasse that has angered Moslem leaders and Syrian officials, Gemayel told a group of journalists last night that his tenure as president was not the issue.

"I am not the problem," he said. "I am trying to solve the problem. It was here before I took office."

Gemayel's resistance to a Syrian-brokered reform package, and his suspected involvement in a bloody revolt within the Christian Lebanese Forces militia that toppled Elie Hobeika as its commander, put him at the center of a political storm. Moslem politicians have insisted that Gemayel resign, and there have been threats of a Syrian-backed military offensive against the Christian heartland.

"It is not a piece of cake, the presidency at this stage," Gemayel said. "I am convinced that my presence here is a duty and necessary for the sake and future of the nation. For that I am still here, and I will remain in office."

The term of the 44-year-old president, who took office in 1982, ends in 1988.

Moslem and Druze militia leaders, who, with Hobeika, signed the Syrian-brokered accord on Dec. 28, responded to Gemayel's declaration with new calls for his resignation.

Nabih Berri, a member of the coalition Cabinet and leader of the Shiite Moslem Amal militia, called Gemayel "the basic obstacle in the way of implementing the agreement" and called for his "removal."

Berri, whose community stands to gain the most from the draft accord, warned that anyone attempting to prolong the Lebanese crisis "should know that this regime is over, and there will henceforth be no post that is the monopoly of any specific community."

Under Lebanon's traditional power-sharing formula, the president is always a Maronite Christian, the prime minister a Sunni Moslem and the speaker of the house a Shiite Moslem. The stalled peace pact would reduce the power of the president and give Christians and Moslems equal representation in the parliament, where Christians now have a 6-to-5 advantage.

The accord also would provide for a special and privileged relationship between Lebanon and Syria.

Druze leader Walid Jumblatt, the third signer of the pact, contends, with Berri, that Gemayel's refusal to step down will spell economic ruin.

A source close to Gemayel said the president was not reflecting only his own views or those of his Christian community but also those of Moslem and religious figures by contesting certain clauses of the agreement.

The reference apparently was to Lebanon's Sunni Moslems, who were not a party to negotiations leading up to the accord.

Berri did not rule out a military showdown and predicted a popular revolt. "We are on the threshold of a popular revolt that has no sectarian character," he said.

Angered by a Gemayel move to try to submit the Syrian pact to the Christian-controlled parliament for discussion, Gemayel's Syrian-backed Moslem and Christian opponents have used the prospect of military escalation and force in an effort to unseat him.

Pro-Syrian militias are entrenched on peaks overlooking Gemayel's summer palace and home town of Bikfaya, and Druze gunners fight daily battles with the Lebanese Army along a mountain ridge controlling access to Baabda, his winter seat.

Advisers to Gemayel justify his refusal to endorse the accord without consultation and discussion, and they insist that he is not empowered to do so by the constitution.

"The president does not have the power constitutionally to proclaim war, make constitutional changes or define relations between two countries," one adviser said.

Meanwhile, Gemayel has tried to reopen his ties with Syrian President Hafez Assad after a hiatus of three weeks. He called Assad yesterday to condemn Israel's interception of a Libyan jet carrying a Syrian delegation and offered Lebanon's assistance at the United Nations.

The official Lebanese press played up the report, suggesting that contact had been reestablished after an icy silence from Damascus, but newspapers in Moslem west Beirut belittled the significance of the Assad-Gemayel conversation.