The first miner to be rescued was Florencio Avalos
The first four of 33 miners trapped underground for more than two months in northern Chile have now been rescued.
Florencio Avalos was first to reach the surface, at 0010 local time (0310 GMT), after being winched up in a capsule.
He was greeted by family and hugged by President Sebastian Pinera. Next to emerge were Mario Sepulveda, Juan Illanes and the only non-Chilean, Bolivian national Carlos Mamani.
In an address at the mine, Mr Pinera declared the rescue a miracle.
Smiling broadly, he thanked the technical experts who had made it possible and said it was a night of emotion.
Recalling the devastating earthquake that struck Chile in February, he said the miners had shown that “when Chile is united, we are capable of doing great things”.
BBC News, Copiapo
From the media platform that has been carved into a mountainside overlooking the San Jose mine, I could see directly down into the area where Florencio Avalos emerged from the escape capsule. He looked astonishingly relaxed and walked without assistance. Waiting for him was his young son, who burst into tears as he embraced his father. Mr Avalos was then given a huge bear-hug by President Pinera and was greeted by senior members of the rescue team. He was wearing sunglasses to protect his eyes, which have not seen natural light for over two months. He was then taken by stretcher to a medical area.
The next man up was Mario Sepulveda, the showman of the group. He is the one who has acted as compere in the videos the miners have sent to the surface. It will be many hours more before all the miners are brought up. But with two successfully above ground, the relief at Camp Hope is tangible. The relatives have seen that the capsule works. They know they should be reunited with their loved ones soon.
“This country shows its true soul, shows what is capable of, when we face adversity.”
But the president added: “This won’t be over until all 33 are out.”
The rescue operation began shortly after 2315 local time (0215 GMT) with a technical expert, Manuel Gonzalez, being lowered down the 624m (2,047ft) shaft.
Mr Gonzalez was supposed to return to the surface and report on the condition of the rescue shaft, and then repeat the journey, before handing over to a paramedic.
However, a live video feed from the refuge where the miners were gathered showed Mr Avalos preparing to be winched up immediately. He was chosen to lead the way because he was one of the fittest of the miners.
A minute after the “Phoenix” capsule reached the top of the rescue shaft, Mr Avalos stepped out and was greeted by his family, rescuers and the president and the first lady, Cecilia Morel. He smiled widely.
Bystanders cheered and clapped, and then started chanting “Chile”.
Mr Avalos gave a thumbs-up before being taken in an ambulance to a medical triage centre and then given time with his family.
President Pinera described how lovely it was to see Mr Avalos’s sons greet their father, especially seven-year-old Bairon.
“I told Florencio that few times have I ever seen a son show so much love for his father,” Mr Pinera said.
Mr Sepulveda reached the surface about an hour later.
BBC Mundo’s Rodrigo Bustamante says Mr Sepulveda appeared in perfect physical and emotional condition. He demonstrated an amazing sense of humour before running towards a group of rescuers and leading them in singing. He brought with him a bag of souvenir rocks from the bottom of the mine.
Officials said they believed they should be able to rescue one miner each hour.
Bolivian President Evo Morales is expected to arrive at the mine later on Wednesday to meet Mr Mamani.
During their journey to the surface, the miners are wearing a “bio-harness” designed for astronauts, which will monitor their heart rate, breathing, temperature and oxygen consumption.
The top of the shaft has been reinforced with metal casing to prevent crumbling surface rocks from breaking away during the rescue. Experts said the rest of the escape shaft was dug through solid rock and would not break up.
Officials said the first few men to be winched to the surface would include some of the most psychologically stable and experienced of the miners, in case something went wrong during the first few rescues.
Next would be those who were weakest or ill, the added. One miner suffers from hypertension. Another is a diabetic, and others have dental and respiratory infections or skin lesions caused by the humidity in the mine.
After they have been reunited with their families, the miners will be flown to hospital in the nearby city of Copiapo, which is on standby to receive them. Outside the hospital, barriers have been set up to cope with the crowds of onlookers and journalists.