In Devon, England,
Ted, who has a bad leg and is an alcoholic, has fallen behind on the rent. He promises to pay Lyons after the family sells its turnip crop. Rose shows Albert his father's medals from the Second Boer War in South Africa, where Ted served with the Imperial Yeomanry. Ted was severely wounded in action, and received the Distinguished Conduct Medal for bravery under fire. She gives Albert his father's regimental pennant, telling Albert that his father was not proud about what he did during the war, and that he had thrown the flag and medals away, though Rose saved and kept them hidden. Albert trains Joey for the plough and, to his neighbours' astonishment, prepares a stony hillside field to plant with turnips. But a rainstorm destroys the turnip field and, to pay the overdue rent (and without telling Albert), Ted sells Joey to Captain Nicholls as World War I breaks out. When Albert finds out, Nicholls promises him he will take care of Joey and hopefully return him after the war. Albert tries to enlist in the army, but is too young. Before the captain leaves with Joey, Albert ties his father's pennant to Joey's bridle.
Joey is trained for military operations and deployed to France with Captain Nicholls. In France, Captain Nicholls is killed in a cavalry charge, and the Germans capture the horses. Joey becomes attached to Topthorn, a larger black horse he had military training with. The two horses are used to pull an ambulance wagon driven by two German soldiers, Gunther, and his 14-year-old brother, Michael. Gunther gives the pennant to Michael when he is assigned to the German front, but then steals the horses so he and his brother can ride them back to Germany. One night, German soldiers discover the absent without leave brothers hiding in a windmill and execute them by firing squad for desertion.
A young French girl named Emilie finds the two horses inside the windmill. Emilie, who suffers from an unspecified illness, lives with her grandfather, who owns the property. Later, German soldiers arrive and confiscate all food and supplies from the property. Emilie's grandfather allows her to ride Joey on her birthday, but when the German soldiers return, they take the horses, though the grandfather keeps the pennant.
The story shifts to Albert, who has now enlisted and is fighting alongside Andrew in the Second Battle of the Somme in 1918, under the command of Lyons's son, David. After a British charge into no-man's land, Albert, Andrew, and other British soldiers miraculously make it across into a deserted German trench, where gas bombs explode, filling the trench with white fumes.
Joey and Topthorn are now being used to pull German heavy artillery, causing Topthorn to die from exhaustion. Joey escapes and runs into no-man's land where he gets entangled in barbed wire. Both British and German soldiers spot Joey and try to coax him to their respective sides. A British Geordie soldier named Colin, waving a white flag, arrives at Joey's side. A German soldier named Peter from Düsseldorf also comes over with wire cutters, and together they free Joey from the barbed wire. They flip a coin to decide where Joey goes; Colin wins and takes Joey back to the British camp.
Andrew died in the gas attack, but Albert survived, though he is temporarily blinded, with bandages covering his eyes. He is recuperating at a British medical camp when the Geordie soldier brings Joey into the medical camp looking for a veterinary surgeon. Meanwhile, Albert is told about the miracle horse back from no-man's land. The army doctor instructs Sgt. Fry to put Joey down due to his injuries, but when Fry is about to shoot, a soft whistle catches Joey's attention. Albert is led through the crowd to Joey, again whistling, while Joey comes over to Albert.
Albert says that he raised Joey, and gives the exact description of his horse markings, confirming his claim. The war ends and Albert's eyesight is restored, but only officers' horses will be shipped home. Joey and the others are to be auctioned off to the highest bidder. The soldiers gather funds to buy Joey for Albert, but during a bidding war with a French butcher reaching 30 pounds, an older gentleman suddenly arrives and bids 100 pounds, winning Joey. The man is Emilie's grandfather. It is implied that Emilie has died, and after hearing about the miracle horse, her grandfather walked three days to get Joey back for the sake of Emilie's memory.
Albert pleads with Emilie's grandfather for the horse to no avail, but before leaving, the grandfather pulls out the pennant and asks if it means anything to Albert. On being told it belonged to Albert's father, the grandfather has a change of heart, and gives Albert the flag and Joey, saying it is what Emilie would have wanted. In the end, Albert rides Joey back to his family's farm and returns the pennant to his father