A car bomb devastated a packed mosque in Tripoli today as worshipers gathered for midday prayers on the Moslem sabbath. At least 19 persons were reported killed and 43 wounded in the explosion in a pro-Syrian neighborhood of the strife-torn northern port city.

Another powerful explosion last night brought down a five-story residential building in Ain Rummaneh, a war-scarred Christian neighborhood in Beirut. Early reports indicated that at least one person was killed and nine others wounded in that blast.

The attacks came as President Reagan's new Middle East envoy, Robert C. McFarlane, announced that he would go to Damascus Saturday for his first talks with Syrian leaders. There was little expectation here that he would achieve results quickly or that the deteriorating situation here would improve soon.

When Christian Phalangist militiamen rushed to the scene of the Beirut blast they scuffled with police over control of the rescue operation.

Journalists were ordered away by militiamen and residents, and the film of at least one television crew was seized. Both the Lebanese Forces Christian militiamen and the legitimate authorities were claiming to have made arrests this evening in connection with the bombing.

Tripoli is in Syrian-controlled territory, but the city itself has never been conquered by the Syrians. Pro- and anti-Syrian militias who rule the town have battled regularly, and for months Syrian forces have maintained a low profile there. Last week Syrian troops moved out of their three barracks in the city and took positions in the suburbs.

Reporters who visited Tripoli said the bomb collapsed one-third of the stone mosque into rubble and sent glass flying for half a mile. Buildings nearby were also damaged and cars set ablaze.

Weeping women and children waited near the entrance of the mosque for information about missing loved ones.

As the injured were rushed to hospitals, the sounds of machine-gun fire could be heard. Tripoli residents said it came from militiamen firing to clear the way for ambulances.

They said some sniping between pro- and anti-Syrian militias had occurred shortly after the bombing, but calm was restored later. But tension remained high in the anti- Syrian stronghold where the explosion occurred, a Sunni Moslem middle-class hillside neighborhood of high rises overlooking the sea. Anti-Syrian militiamen deployed along their barricades facing pro-Syrian Alawite Moslem militiamen.

By this evening, no group had claimed responsibility for the bombing. The leader of the fundamentalist Islamic Unity Party, which fields the largest of several militias operating in Tripoli, issued a statement blaming it on "agents" of the Lebanese government and the Christian Phalangist Party, which is headed by Pierre Gemayel, father of Lebanese President Amin Gemayel.

Other Moslem leaders issued statements denouncing the bombing.

McFarlane, after a 75-minute meeting with Lebanese Prime Minister Shafiq Wazzan, told reporters he intended to go to Syria Saturday to "press on with determination the absolute commitment of the United States to succeed." He did not mention the bombing.

Lebanese government officials have said repeatedly that foreign forces must withdraw if Lebanon is to rebuild the war-shattered country and restore some measure of calm. Syria has refused to leave, triggering a stalemate in which Israeli forces also have remained.

Although Syrian leaders declined to see the last U.S. Middle East envoy, Philip C. Habib, they reportedly have agreed to receive McFarlane. It is understood here that Syrian leaders harbored hostility toward Habib since last summer when cease-fires he arranged collapsed and Israeli planes resumed bombing raids.

It is understood, however, that McFarlane comes with no dramatic new U.S. positions or any signals that Syria is relenting. Syria has demanded that Lebanon's agreement for Israeli withdrawal be abrogated and Israel leave unconditionally before Syria will withdraw.