The security officials said police opened fire, killing one of the attackers.
Twenty-five people were wounded in the melee, including 18 police who were hit with stones and glass. The officials spoke on condition of anonymity because they were not allowed to brief the media.
Locals watching the attack said some people were shouting, “We don’t want the pope” and “No more insults (to Islam).”
The incident came as Pope Benedict began a three-day visit to Lebanon and as anger over a film which Muslims have said is blasphemous to Islam spread across the region.
Speaking to political and religious leaders on the second day of a three-day trip to Lebanon, he stressed that people must repudiate vengeance, acknowledge their own faults and offer forgiveness to each other.
“Religious freedom is a fundamental right … Preaching and living freely one’s own religion without endangering own’s life and freedom, should be possible to everyone,” the Pope said in a speech at the presidential palace.
“A commitment to peace is possible only in a unified society … If we want peace, let us defend life. This approach leads us to reject not only war and terrorism, but every assault on innocent human life, on men and women as creatures willed by God.”
Thousands of people, mostly Christians and including many children, had lined the road leading to the palace, hoping to catch a glimpse of the Pope as he headed to the presidential palace.
Among them were Egyptians, Iraqis, Jordanians and Palestinians who came to witness the first papal visit to Lebanon since the late John Paul II came in 1997.
The frail-looking 85-year-old pontiff, walking with the aid of a cane, first met President Michel Sleiman, a Maronite Christian.
Then, before talks with the Muslim leadership, he met Prime Minister Nagib Mikati, a Sunni, and parliament speaker Nabih Berri, a Shi’ite.
Lebanon has an unwritten but rigourously followed tradition that the three top jobs are always reserved for members of those respective faith communities.
Those who desire to live in peace must have a change of heart, the Pope said, and that involves “rejecting revenge, acknowledging one’s faults, accepting apologies without demanding them and, not least, forgiveness.”
He said the universal yearning of humanity for peace can only come about through community, comprised of individual persons, whose aspirations and rights to a fulfilling life are respected.
Lebanon is a multi-faith country in which Muslims make up about 65 per cent of the population and Christians the balance.
The Pope came with a message of peace and reconciliation to it and to the wider Middle East, which have been torn by violence, often sectarian, over the years.
“Why did God choose these lands? Why is their life so turbulent,” he asked.
“God chose these lands, I think, to be an example, to bear witness before the world that every man and woman has the possibility of concretely realising his or her longing for peace and reconciliation. This aspiration is part of God’s eternal plan and he has impressed it deep within the human heart.”
The Pope noted that Christians and Muslims have lived side by side in the Middle East for centuries and that there is room for a pluralistic society.
“It is not uncommon to see the two religions within the same family. If this is possible within the same family, why should it not be possible at the level of the whole of society?
“The particular character of the Middle East consists in the centuries-old mix of diverse elements. Admittedly, they have fought one another, sadly that is also true. A pluralistic society can only exist on the basis of mutual respect, the desire to know the other and continuous dialogue.”