Helicopters on Friday ferried out the last tourist stranded near Machu Picchu, Peruvian police said.
Col. Santiago Vizcarra said 1,277 foreigners were evacuated Friday. He said a total of 3,900 tourists and local people were flown out of the tiny mountain village of Machu Picchu Pueblo this week.
Mudslides and torrential rains on Sunday destroyed sections of the railway that is the only form of transit in and out of the village below the Machu Picchu citadel.
Friday's rescue flights began as the sun rose to a clear sky over the shaggy, green Andean peaks.
"The sun came out a bit this morning and I hope I can get back to Cuzco today, and then head home to Brazil," tourist Ana Gutierrez said.
'Chaos' at fabled citadel
Authorities said Machu Picchu will remain closed for weeks until the government can repair roads and railroad tracks washed out by mudslides and the raging Urubamba River.
The hordes of outsiders caught in Machu Picchu Pueblo, a town of 4,000 people, strained food and water supplies.
Hotels overflowed, and travelers grew frustrated over chaotic relief efforts, price-gouging and scarce food. Many were left to eat from communal pots and bed down in train cars, outdoors and wherever they could find space.
Sofie Mag, a 19-year-old from Frederiksberg, Denmark, said a manager at the Sanctuary Lodge, right next to the ruins and a 45-minute bus ride from Machu Picchu Pueblo, let her and other tourists sleep on the floor of the building's restaurant.
"It was free and we got food also," Mag said. "We were very lucky to be up there. ... The first day was chaos."
Authorities closed the Inca trail, a popular four-day trek that ends in Machu Picchu, after a mudslide killed two people Tuesday. The trail also is likely to remain closed for weeks, and is seldom used at the height of the area's rainy season in February.
Rescue efforts have been complicated by bad weather and terrain — the village is wedged between a sheer, verdant mountainside and the Urubamba River. Rain prevented helicopters from landing in the town until after midday both Tuesday and Wednesday, but the skies improved since then.
Evacuations were conducted by age — oldest and youngest first.
The last middle-aged tourists left Thursday from a makeshift helicopter clearing, as younger backpackers played football with locals and lent a hand stacking sandbags and clearing train tracks.
When mudslides Sunday destroyed the railway, many hotels and restaurants raised prices exorbitantly. Tourists who could afford to do so paid the higher rates, while others spent days sleeping in train cars and waiting for delayed food shipments.
'All about money'
Dina Sofamontanez, who runs Hostal El Inka, said she dropped prices when tourists ran out of money, while some hotels on the main avenue raised theirs fivefold up to $50 a night.
"It's all about money," she said.
When ATMs ran dry, many backpackers slept in the central plaza.
"We had to eat what the locals gave us, out of communal pots," 34-year-old Argentine tourist Sandra Marcheiani said. "The last few days I've shared beds with other people."
Some 400 Americans were said to be among those stranded when train service initially stopped.
Karel Schultz, 46, of Niagara Falls, said before being flown out Thursday that most Americans paid for beds and bought their own food, while those who slept in the streets were typically Argentines and other South American backpackers.