The incident follows rising tensions, and is the first deadly clash in the border area in at least 45 years.
The Indian army initially said three of its soldiers had been killed, adding that both sides suffered casualties.
Early on Tuesday the Indian army said three of its soldiers, including an officer, had died in a clash in Ladakh, in the disputed Kashmir region.
Later in the day, it released a statement saying the two sides had disengaged.
It added that "17 Indian troops who were critically injured in the line of duty" and died from their injuries, taking the "total that were killed in action to 20".
India's external affairs ministry accused China of breaking an agreement struck the previous week to respect the Line of Actual Control (LAC) in the Galwan Valley.
China did not confirm any casualties, but accused India in turn of crossing the border onto the Chinese side.
Chinese foreign ministry spokesman Zhao Lijian said India had crossed the border twice on Monday, "provoking and attacking Chinese personnel, resulting in serious physical confrontation between border forces on the two sides", AFP news agency reported.
Meanwhile, in a statement, Senior Colonel Zhang Shuili, spokesperson for the Western Theater Command of the Chinese People’s Liberation Army said, "We demand the Indian military strictly restrain its frontline troops, immediately stop all infringing and provocative actions, work with the Chinese side towards the same goal, and return to the right track of resolving differences through dialogue and talks.”