"We give thanks to God our Lord and the Virgin Mary for having saved from death 20 artisanal miners," First Lady Rosario Murillo, the presidential spokeswoman, told reporters.
Murillo said five miners had "not surfaced" and rescue crews were still working to locate them.
The miners were pulled out one at a time using a pulley system installed late yesterday near the pit where they had been trapped.
They were immediately embraced by family members, who had stayed nearby since the accident, and then taken to the nearest hospital.
Also Read
There had been 28 "guiriseros," or informal gold miners, working in the shaft when the mouth of the mine caved in because of a landslide triggered by heavy downpours, early Thursday morning.
Two workers buried near the surface had earlier managed to dig their way out after the collapse in the remote village of El Comal in northeastern Nicaragua, according to the local disaster prevention committee.
A local TV station showed what appeared to be the body of a dead miner being recovered.
The accident happened at an artisanal mine near the town of Bonanza, which is perched on the side of a hill, in a region that is home to Nicaragua's biggest gold mines.
Desperate relatives initially tried to dig through to the trapped miners before being stymied by the unstable terrain, news reports said.
Word of the collapse only emerged late Thursday because the site is so remote, local disaster official Martha Lagos said.