The controversial race has become a source of outrage in China after organisers apparently ignored warnings of extreme weather.
The race was halted and a massive rescue operation launched after reports that some of the 172 runners had gone missing.
Many of the stranded runners reportedly suffered from hypothermia, and had lost their way on the route as heavy rain and hail affected visibility.
REUTERS- A rescue operation was launched to save stranded runners, but not everyone survived
Among the 21 competitors who died was Liang Jing, one of China's most accomplished ultramarathoners. Mr Liang was pictured beginning the race in just shorts, a thin jacket and a baseball cap.
The 31-year-old had won numerous long-distance races in China, including the Ultra Gobi in 2018 - a 400km race through the Gobi desert.
Another victim, Huang Guanjun, 34, was hearing-impaired and unable to speak, reports said. He was known for winning the men's hearing-impaired marathon at China's 2019 National Paralympic Games.
Surviving participants of the abandoned ultramarathon said the forecast had indicated there would be some wind and rain, but nothing as extreme as what they experienced.
The deaths have sparked public outrage on Chinese social media, with anger mainly directed at the local government in the city of Baiyin and unhappiness over the lack of contingency planning.
In a news conference on Sunday, Baiyin's Mayor Zhang Xuchen said: "As the organiser of the event, we are full of guilt and remorse. We express deep condolences and sympathy to the families of the victims and the injured."
Mobile Device Users - Click 3 Dots Below to View Complete Page
I am crucified with Christ: nevertheless I live; yet not I, but Christ liveth in me: and the life which I now live in the flesh I live by the faith of the Son of God, who loved me, and gave himself for me. Galatians 2:20