The operation to save the men trapped more than 200 metres underground took two hours as they were hauled up to the surface one by one in a narrow capsule, according to state broadcaster CCTV.
Dramatic footage released by CCTV showed rescue crews applauding as the men were brought above ground in Shandong province, eastern China.
The men were shown being wrapped in military blankets, blindfolded to protect their eyes, and put into ambulances.
They had suffered no major injuries and would soon be able to return home, Xinhua quoted Cao Qingde, deputy head of the local hospital where they are being treated, as saying.
The four were among 29 trapped when the mine collapsed on December 25. Of the 29 miners, 11 were rescued the following day and one was pronounced dead while 13 remained unaccounted for following the rescue, CCTV said.
Rescuers first detected signs of life on December 30.
The four were named by CCTV as Hao Zhicheng, aged 50, Li Qiusheng, aged 39, Guan Qingji, aged 58, and Hua Mingxi, aged 36.
Rescuers managed to contact the miners on January 8, the broadcaster reported, and sent down food, clothes and lamps through a tunnel.
However, complicated geological conditions made the rescue difficult with crews having to face structural instability of the tunnel and falling rocks.
The incident was the latest deadly accident in a country where safety rules are often flouted to cut costs.
The mine owner committed suicide by drowning himself at the scene soon after the collapse, Xinhua reported previously.
The cause of the collapse is under investigation, but industrial safety regulations are often flouted in China and corruption enables bosses to pursue profits at the cost of worker safety.
Four officials in Pingyi, where the mine is located, including the county's party chief and head of government, were removed from their posts in the wake of the accident.
The gypsum pit and other mines in its vicinity were ordered to stop production in October by local authorities because of a risk of sinkholes, but it kept operating secretly, the Beijing Times reported earlier.
Accidents linked to lax industrial safety enforcement have seen hundreds of people killed in China this year, including this month's landslide in the southern commercial hub of Shenzhen and chemical blasts in the industrial city of Tianjin in August.
China is the world's largest coal producer and official data showed colliery accidents killed 931 people last year.
The government says the number of fatalities is declining, but some rights groups argue the actual figures are significantly higher due to under-reporting.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.