After more than 30 hours of confusion, the body of American hostage Peter Kilburn was identified this afternoon by doctors at the American University hospital here and by friends who knew the ailing, 60-year-old librarian, missing since Dec. 3, 1984.

Kilburn's body, found early Thursday, had been mistaken for that of British journalist Alec Collett, 63, who was grabbed by gunmen south of Beirut on March 25 last year.

Kilburn's was the first body of an American captive to surface in Lebanon. An announcement last Oct. 4 that U.S. Embassy political officer William Buckley had been executed in retaliation for an Israeli raid against Palestine Liberation Organization headquarters in Tunis has yet to be verified.

[Officials in Washington said yesterday that they wanted "positive forensic identification" before confirming Kilburn's death and said the body will be flown to an American military hospital in West Germany for further examination.]

Kilburn, who had worked for 20 years as the librarian at the American University here and who was well known for his generosity to students and others, had suffered a stroke before his capture. Friends said they were surprised he had survived so long in captivity.

British diplomats today confirmed that two slain Britons found with Kilburn in a forsaken mountain lane in the Druze-held hills were Philip Padfield, 40, the director of an English-language institute, and Leigh Douglas, 34, a professor of political science at the American Unversity of Beirut.

Representatives of the United Nations Relief and Works Agency, which had employed Collett as a free-lance writer last year, visited the hospital morgue and determined that the body was not Collett's.

The initial identification was also found to be incorrect when Collett's daughter said her father had only nine fingers. A senior hospital administrator disclosed late in the afternoon that a reexamination of the corpse showed it was indeed that of Kilburn.

The Arab (Fedayeen) Commando Cells, a little-known group suspected of having links to Libya, claimed in a scribbled note found next to the three victims' bodies that it had executed an American officer of the Central Intelligence Agency and two British intelligence agents.

Padfield, Douglas and Kilburn, all shot in the head, were dumped in an alley off the Beirut-Damascus highway leading to the Syrian-controlled Bekaa Valley. The location is under Druze militia control but is also accessible to Syrian troops, Palestinian guerrillas and other forces based in eastern Lebanon.

The note said the three had been killed "in reprisal for the new Nazi line taken by the leader of international terrorism, the criminal [President Ronald] Reagan and his decision to attack our Arab Libyan people and its revolutionary leadership with the direct support of the British government."

The deaths have triggered fears for the safety of other American hostages still detained in Lebanon. Islamic Jihad, a front organization believed to have links to Iran, says it is still holding Terry Anderson, Associated Press bureau chief in Beirut; Thomas Sutherland, dean of the school of agricultural engineering at the American University here; David Jacobsen, the director of the American University hospital, and the Rev. Lawrence Jenco, head of the Catholic Relief Service in Lebanon.

The Revolutionary Organization of Socialist Moslems, the group claiming to hold Collett, has urged other kidnapers to carry out "the verdict of death" against other British and American hostages.

At least 20 foreigners are now missing in Lebanon.

The statement issued yesterday to news organizations on behalf of the Revolutionary Organization of Socialist Moslems lauded France and other European countries that refused to aid the United States in the latest raid against Libya. The statement said nationals of those countries need not worry.

It was still questionable, however, whether the statement was authentic. It said Collett had been executed by hanging and promised that a photograph of the "hanging ceremony" would be delivered to the offices of the independent An Nahar newspaper. By late this evening, no pictures had been received.

British Foreign Secretary Geoffrey Howe said in London that his country had good reason to believe that Padfield and Douglas had been in Libyan hands when they were murdered. Reports that the three foreigners were handed over to Libyans in Lebanon by their kidnapers a week ago could not be confirmed.

The kidnapers of John McCarthy, 29, acting bureau chief of Worldwide Television Network, a London-based news agency, today contacted his office and said the missing Briton, kidnaped on his way to the airport yesterday, was alive and well. The captors said his colleagues could come and collect their car, seized from McCarthy's driver by four gunmen. News agency employees did manage to recover the car tonight, but there was no further news of McCarthy.