In 1863, First Lieutenant John J. Dunbar is wounded in the American Civil War. Choosing suicide over having his leg amputated, he takes a horse and rides up to the Confederate front lines, distracting them in the process. The roused Union army then attacks and the battle ends in a Confederate rout. Dunbar survives, is allowed to recover properly, receives a citation for bravery, and is awarded Cisco, the horse who carried him, as well as his choice of posting. Dunbar requests a transfer to the western frontier so he can see its vast terrain before it disappears. Dunbar arrives at his new post, Fort Sedgwick, but finds it abandoned and in disrepair. Despite the threat of nearby Indian tribes, he elects to stay and man the post himself. He begins rebuilding and restocking the fort and prefers the solitude afforded him, recording many of his observations in his journal.
Meanwhile Timmons, the wagon driver who transported Dunbar to Fort Sedgwick, is killed and scalped by Pawnee Indians on his way back to Fort Hays. Timmons's death and the suicide of Major Fambrough, who had sent them there, prevents other soldiers from knowing of Dunbar's assignment to the post, effectively isolating him. Dunbar notes in his journal of how strange it is that no other soldiers join him at the post.
Dunbar initially encounters his Sioux neighbors when several attempts are made to steal his horse and intimidate him. In response, Dunbar decides to seek out the Sioux camp in an attempt to establish a dialogue. On his way he comes across Stands With A Fist, who is attempting suicide in mourning her deceased husband. She is the white adopted daughter of the tribe's medicine man Kicking Bird, her original family having been killed by the aggressive Pawnee tribe when she was young. Dunbar returns her to the Sioux to be treated, which changes their attitude toward him. Eventually, Dunbar establishes a rapport with Kicking Bird and warrior Wind In His Hair who equally wish to communicate. Initially the language barrier frustrates them, so Stands With A Fist, though with great difficulty remembering her English, acts as translator.
Dunbar finds himself drawn to the lifestyle and customs of the tribe and begins spending most of his time with them. Learning their language, he is accepted as an honored guest by the Sioux after he locates a migrating herd of buffalo and participates in the hunt. When at Fort Sedgwick, Dunbar also befriends a wolf he dubs "Two Socks" for its white forepaws. When the Sioux observe Dunbar and Two Socks chasing each other, they give him the name "Dances with Wolves". During this time, Dunbar also forges a romantic relationship with Stands with a Fist and helps defend the village from an attack by the rival Pawnee tribe. Dunbar eventually wins Kicking Bird's approval to marry Stands with a Fist, and abandons Fort Sedgwick.
Because of the growing Pawnee and white threat, Chief Ten Bears decides to move the tribe to its winter camp. Dunbar decides to accompany them but must first retrieve his journal from Fort Sedgwick as he realises that it would provide the army with the means of finding the tribe. However, when he arrives he finds the fort re-occupied by the U.S. Army. Because of his Sioux clothing, the soldiers open fire, killing Cisco and capturing Dunbar, arresting him as a traitor. Senior officers interrogate him, but Dunbar cannot prove his story, as a corporal has found and discarded his journal. Having refused to serve as an interpreter to the tribes, Dunbar is charged with desertion and transported back east as a prisoner. Soldiers of the escort shoot Two Socks when the wolf attempts to follow Dunbar, despite Dunbar's attempts to intervene.
Eventually the Sioux track the convoy, killing the soldiers and freeing Dunbar. At the winter camp, Dunbar decides to leave with Stands With A Fist, since his continuing presence will put the tribe in danger. As they leave, Wind In His Hair shouts to Dunbar, reminding him of their friendship. U.S. troops are seen searching the mountains but are unable to locate them, while a lone wolf howls in the distance. An epilogue then states that thirteen years later the last remnants of the free Sioux were subjugated to the American government, ending the conquest of the Western frontier states and the livelihoods of the tribes on the plains.