(CNN) -- Thirty-three miners trapped underground in Chile sent a note on Sunday saying they are alive, raising hopes for the first time in the nearly three weeks since the mine collapsed, but officials cautioned it could take months to rescue the workers.

The miners sent their rescuers a handwritten message that said all of them are alive and in a shelter, said Chilean President Sebastian Pinera. The note was tied to a probe authorities had lowered earlier on Sunday.

"Now we know the most important thing. They are alive," said an elated Pinera, who spoke outside the mine.

Cheers erupted around the president as relatives and friends of the miners shed tears and shared hugs, video from CNN Chile showed. The workers have been trapped since the mine caved in on August 5.

Video from CNN Chile, taken with a small camera sent underground after rescuers retrieved the message, showed the top half of a miner's face as it emerged into view. He appeared alert.

Andres Sougarret, who is in charge of rescue operations, said he hoped to make further contact with the trapped miners later on Sunday, though he warned it could take as long as four months to get them out.

The miners are thought to be inside a small shelter that would have had some water and food supplies, said CNN Chile Correspondent Francisco Siredey. The shelter is some 2,300 feet underground.

Because of the mine's depth, and the instability caused by the collapse, rescue workers will need to proceed slowly and with caution.

Sougarret said rescuers will send microphones down soon in hopes of learning more about the miners' conditions. Authorities are also planning to send food, medicine and other necessities as needed. Eventually, rescue workers will likely drill a larger shaft, through which the trapped miners could escape.

"It'll take time. But it's not important how long it takes. What's most important is that everything ends well," said Pinera.

Beaming, the president held the note pulled from the mine up for television cameras. Written in Spanish in red ink, it read simply: "The 33 of us are fine in the shelter."

The San Esteban mine, which produces copper and gold, is located near the town of Copiapo in the Atacama region in northern Chile.

Rescuers said they also retrieved a second note, written by a miner identified as Mario Gomez to his family. Pinera handed Gomez' letter, which was wrapped in a plastic bag and tied to the probe with large rubber bands, to the miner's wife.

"I know my husband is fine. I know he's alive. And I know he's keeping up all the others in the mine because that's the kind of person my husband is," said the overjoyed wife, CNN Chile video showed.

"The good thing is that now he's going to come out of there with his life. Thank God." she added.