The children, who survived a small plane crash in the jungle, were transported by army medical plane to a military airport at around 00:30 am Saturday (0530 GMT).
They were taken off the plane on stretchers and wrapped in thermal blankets, with ambulances waiting to bring them to hospital, AFP journalists said.
General Pedro Sanchez, who led the search operation, credited Indigenous people involved in the rescue effort with finding the children.
"We found the children: miracle, miracle, miracle!" was the message he had for the reporters he received on Friday.
President Gustavo Petro announced their rescue and told the media: "Today we have had a magical day."
"They are weak. Let's let the doctors make their assessment," he said.
'A joy for the whole country'
Petro had posted a photo on Twitter showing several adults, some dressed in military fatigues, tending to the children as they sat on tarps in the jungle. One rescuer held a bottle to the mouth of the smallest child, whom he held in his arms.
"A joy for the whole country! The 4 children who were lost 40 days ago in the Colombian jungle were found alive," he wrote on Twitter.
Video shared by the Defense Ministry late Friday showed the children being pulled up into a helicopter as it hovered over the tall trees in almost complete darkness.
Originally from the Huitoto Indigenous group, the children -- aged 13, nine, four and one -- had been wandering alone in the jungle since May 1, when the Cessna 206 in which they were traveling crashed.
The pilot had reported engine problems only minutes after taking off from a jungle area known as Araracuara on the 350-kilometer (217-mile) journey to the town of San Jose del Guaviare.
The bodies of the pilot, the children's mother and a local Indigenous leader were all found at the crash site, where the plane sat almost vertical in the trees.
Officials said the group had been fleeing threats from members of an armed group.
A massive search involving 160 soldiers and 70 Indigenous people with intimate knowledge of the jungle was launched after the crash, garnering global attention.
Army chief Helder Giraldo said rescuers had covered over 2,600 kilometers (1650 miles) in total to locate the children. "In an unprecedented operation in the history of our country... something that seemed impossible was achieved," Giraldo said on Twitter.
The area is home to jaguars, snakes and other predators, as well as armed drug smuggling groups, but clues such as footprints, a diaper, and half-eaten fruit led authorities to believe they were on the right track.
Worried that the children would continue wandering and become ever more difficult to locate, the air force dumped 10,000 flyers into the forest with instructions in Spanish and the children's own Indigenous language, telling them to stay put.
The leaflets also included survival tips, and the military dropped food parcels and bottled water.
Rescuers had also been broadcasting a message recorded by the children's grandmother, urging them not to move.
According to the military, rescuers found the children about five kilometers (three miles) west of the crash site.
Huitoto children learn hunting, fishing and gathering, and the kids' grandfather, Fidencio Valencia, had told AFP the children are well acquainted with the jungle.
"I just want to see them, to touch them," he said early Saturday after learning of their rescue.
The children's grandmother Fatima Valencia said 13-year-old Lesly kept her younger siblings safe with her "warrior" spirit.
'Alliance for the country to follow'
News came as Petro returned home from Cuba, where he signed a six-month truce with Colombia's last active guerrilla group, the ELN.
"Getting closer and attaining peace in the agreement that is moving forward with the ELN... And now I return and the first news is that indeed the Indigenous communities that were in the search and the military forces found the children 40 days later," he told reporters in Bogota.
"They were alone, they made it on their own. An example of absolute survival that will go down in history," he said.
Seventeen days after the children went missing, Petro announced that they had been found alive but he retracted the statement a day later, saying he had been given false information.
On Friday, he praised "the effective coordination between the military and the Indigenous people" during the search, saying it was an "example of an alliance for the country to follow."