According to AFP, four rescuers were also badly injured during emergency efforts at the mine, in remote Samangan province.
"Today, 24 bodies have been recovered and four that are still under the rubble have been pronounced dead," A Samangan provincial spokesman told the news service.
The Afghan government has recently closed down several coal mines in the northern provinces due to safety concerns.
There was a similar mine disaster in neighbouring Baghlan province that killed 11 workers in December.