The ceremony took place under the watch of an Israeli security tower.
"In a world where more and more borders are being opened up – to trade, to travel, to movement of peoples, to cultural exchanges – it is tragic to see walls still being erected. How we long to see the fruits of the much more difficult task of building peace! How earnestly we pray for an end to the hostilities that have caused this wall to be built!"
The pope said the solution to the Palestinian issue would only be effective if both parties yield to cooperation with each other.
"History has shown that peace can only come when the parties to a conflict are willing to move beyond their grievances and work together towards common goals, each taking seriously the concerns and fears of the other, striving to build an atmosphere of trust. There has to be a willingness to take bold and imaginative initiatives towards reconciliation: if each insists on prior concessions from the other, the result can only be stalemate."
The father of a man who was detained in Israel 20 years ago was the one in charge of giving the pope his official gift.
Some 5,000 refugees make up the refugee camp where the pope visited. According to the United Nations about 4,600,000 Palestinian refugees are spread out in camps across the Middle East.