The Church of the Nativity in Bethlehem reeked of urine and was strewn with dirty pots and pans, leftover food and mattresses Friday afternoon, but emerged with little permanent damage as the 39-day siege ended with Israel pulling its forces out of the city.

Journalists touring the basilica, one of Christianity's holiest shrines, saw two wooden altars in the Armenian section and a marble baptismal covered with leftover food and dirty dishes.

The stone floor was strewn with dirty blankets and mattresses, lighters, sunglasses, a toothpaste tube, a bottle of aftershave, plastic bags, cigarette butts, a comb and large cooking pots. A stove and gas canisters for cooking stood to one side of the central aisle.

Those inside the church had complained the Israelis occasionally cut the water supply and that water was scarce during the siege. There were no toilets inside the basilica and to get to facilities elsewhere required crossing an open courtyard, with the risk of Israeli sniper-fire.

The panes of several arched windows near the ceiling were broken, but there appeared to be no other damage. A 12th-century mosaic near the ceiling, which one priest had said was hit by bullets, appeared in good condition. A Franciscan study hall next to the church was gutted by fire — Israel and the Palestinians accused each other of sparking the flames — and a statue of the Virgin Mary was hit by a bullet.

The small birth grotto, a few steps below the basilica, was in pristine condition. Priests said some gunmen and foreigners had initially slept there because it was the warmest spot, but agreed to leave so clergy could conduct daily services there.

One priest complained the foreigners had desecrated the church by smoking and drinking alcohol.

A Bethlehem Christian, 18-year-old Sandy Shaheen, was in tears as she looked at the interior of the basilica. "This is the place where Jesus was born. I can't believe this is the house of God — just look at it," said Shaheen, who worships at the Church of the Nativity every Sunday.

Father Nicholas, a Franciscan priest from Mexico, denied Israeli claims the several dozen nuns and priests who stayed in the compound during the standoff were hostages. "We were there by choice," Nicholas said. Priests and nuns have said they remained to protect the site.

Father Nicholas said the gunmen kept their weapons with them at all times, and in the first days took candelabras, icons, candles and "anything that looked like gold." Some of the valuables were later returned, he said.

Reporters saw a cupboard filled with food — more than 20 bags of lentils and rice, cans of beans and cooking oil. For extended periods during the siege, the gunmen had said food was running low and those inside subsisted on one meal a day. Some said they had resorted to making soup from lemon leaves growing in the courtyard. It was not clear whether those accounts were misleading, or whether Israel sent in more food in the last days.

The day's events in Bethlehem began shortly before 7 a.m., when the first of the gunmen walked through the low-slung Gate of Humility, the main door of the 4th-century basilica. The others followed, emerging into the hazy sunlight of Manger Square. Some waved or flashed victory signs, and one dropped to the ground, kneeling in Muslim prayer. Two men were carried out on stretchers.

By midmorning, all Palestinians had left the church, but the standoff was not over. Ten foreigners, who had slipped into the church May 2 in a show of solidarity with the Palestinians, refused to come out — demanding a lawyer and insisting on holding a news conference.

Israeli riot police later entered the compound and removed them by force, with the approval of exasperated priests. The 10, including four Americans, were detained ahead of deportation. Israeli police and soldiers swept the church and said they found 40 explosive devices, several booby-trapped. However, Israeli officials offered little detail.

In their joy over regaining control of the shrine, Greek and Franciscan priests conducted a service and bells pealed for several minutes.

Around sundown, Israeli troops and armored vehicles began leaving Manger Square, and the troop pullback was completed a few hours later.

Bethlehem residents had been subjected to around-the-clock curfews during the 39-day occupation of the city. Hundreds of Palestinians thronged the square after the departure of the Israeli troops, eager to catch up on each other's lives.

Friday's deal ended a week of negotiations, with intense involvement by the United States, the Vatican and the EU.

The standoff began April 2 when more than 200 Palestinians, including wanted militants, policemen and civilians, ran into the church ahead of Israeli troops.

The Associated Press contributed to this report.