YAUCA DEL ROSARIO, Peru — Peruvian miners trapped for six days in an abandoned copper mine prayed and wept during moments of intense anguish, then told each other jokes and even danced to hold onto hope before they finally walked free Wednesday.

The miners, ranging in age from 23 to 58, walked out without assistance about an hour after dawn from a reinforced tunnel that rescuers had built as they removed more than 26 feet of dirt and rock.

"On the second day, we were saying that they weren't going to get us out, that we were going to die in there," said Santiago Tapia, 21, the youngest of the miners. Tapia spoke with The Associated Press at the Social Security Hospital in Ica, where all the miners were taken to recover from dehydration.

"Inside, we prayed, we cried. We also cried with our relatives outside who were desperate," said Tapia, the father of a 2-year-old daughter.

Other moments were lighter. "We conversed, we told each other jokes, talked about our lives, things that had happened to us," Tapia said. "We also talked about politics, a bit of everything. We made ourselves laugh so we wouldn't feel bad inside there."

The miners wore sunglasses and were covered with blankets when they walked free. President Ollanta Humala was there to greet them after spending the night at the mine 150 miles southeast of the capital of Lima.

The miners were trapped by a cave-in triggered by an explosion they themselves had set.

They had communicated with rescuers through a hose, in place before the collapse, by which they also received food and medicine during their ordeal in a horizontal shaft dug into a mountainside.

It became their lifeline. "Thanks to that hose we are now still alive," Tapia said.