Standing at the entrance to the mine shaft, Feng Wenli bade farewell to the job he had done for decades.
"It's a little hard to say goodbye, but it is also good to retire early with compensation," said the 53-year-old.
Beijing's Changgouyu mine has been closed to reduce pollution. The municipal development and reform commission announced this week that the three remaining coal mines in the city will be closed in the next four years, completely eliminating coal mining in the capital.
In 2016, Beijing closed two coal mines ending production of 1.8 million tons each year, said Li Bin, deputy director of the commission's coal office.
Changgouyu, at the foot of the western mountains, produced 1 million tons of high quality coal each year before it closed in June.
Feng lives on the other side of the mountains. He became a miner at the age of 21. He used to get up at 4 am for the morning shift. After a quick breakfast, he would descend the shaft and work until noon.
"We were covered in coal dust by noon and took a bath straight after work," he said. "The mines now are less dusty and safer than before."
Feng still lives in the miner's cottage where he married and raised a son. His son is now a physical education teacher in a city high school. Even with the mine closed, the couple continue living there.
"We are not moving out. I have heard plans to develop tourism in the area," he said.
Accounts of coal mining in Beijing date from the Yuan Dynasty (1271-1368). During the Ming and Qing dynasties, the mountains of western Beijing became known for high-quality coal.
Since the founding of the People's Republic of China in 1949, coal from western Beijing has been a major energy source for the capital, said Geng Yangmou, chairman of Beijing Haohua Energy Resource.
Geng said the government had given more than 160 million yuan ($23 million) in subsidies to Beijing's redundant coal workers and miners in 2016.
Mining areas will be encouraged to develop new industries, and the city will provide support for infrastructure to attract investors, according to Geng.
"Look at the beautiful scenery. I believe it has great tourism potential. The area will be prosperous and live again with new industries," Feng said.
He is considering setting up a business with the 340,000 yuan he received when his contract was ended.
Lyu Fuyue, 51, has been working at Changgouyu mine since he was 24. After retiring in August, he gets 2,000 yuan every month. He has still not figured out what he will do in the future.
"Maybe I will just stay home. It would be good to rest, like the mountains, after years of mining," he said.