The Blue Sword is a 1982 fantasy novel by Robin McKinley about an female orphan named Harry who helps to defend the Damarian and its allies' kingdoms from the invading Northerners. After defying the orders of King Corlath, Harry defends a narrow pass that the king had overlooked. In the end, they win the battle and Corlath and Harry are wedded. The novel deals with themes of fate, love and loyalty, employing a fantastical style and setting.
The story introduces Angharad Crewe, usually referred to as Harry, the daughter of a recently deceased nobleman from the Homeland. The orphaned Harry crosses the ocean to join her brother Richard in Istan, the Homeland's remotest colonial town and military outpost in the Royal Province of Daria. Soon after her arrival, the outpost receives a visit from Corlath, king of the native hill-folk who still view the land as their own, the ancient country they have always called Damar. Corlath has come to warn the "Outlanders" of an impending invasion from the North, a land full of demonic tribes that has recently and uncharacteristically united under the leadership of Thurra, a powerful demon-wizard. But Corlath's warning fails to influence Sir Charles, the Homeland's District Commissioner, and Corlath leaves angry that he tried reasoning with the Outlanders.
Corlath and his men ride away into the desert; however his "kelar," a magical element of the royal bloodline, incites him to return and kidnap Harry. Corlath knows he has to comply with the kelar's compulsion, but he is nonetheless ashamed that he must abduct a young woman, and an Outlander. He commands his people to treat Harry as an honored guest.
Harry's confusion and fear soon give way to wonder when she discovers, to her surprise, that she, too, has abnormally strong kelar. Harry, called Harimad by the Damarians, adjusts quickly and well to life with the king and his people, as Corlath and Mathin help her learn their customs and history. She is learning the language and feel at home by her kelar, and soon adopts the customary dress and horseback-riding skills of a born Damarian. Despite this, Harry is somewhat puzzled at her connection with the people of Damar, as she had been born and raised in the Homeland.
Based on her connection with the legendary heroine Lady Aerin, called Dragon Slayer and venerated as a fierce warrior, whom Harry has seen in vision, Corlath decides that Harry will enter the Laprun trials, an annual competition which proves if a man or woman is worthy to wear a sash (which only sword-bearing citizens can wear). Mathin teaches Harry to ride and to fight like a warrior, which she does and is even able to push him off of his horse while fighting her. When she takes part in the Laprun trials she does extremely well, becoming the Laprun-minta, or first of the Laprun. This is seen as a good omen for the Damarian people because the Laprun-minta is a female warrior, and there have been very few since the age of Aerin. Corlath makes her a King's Rider and gives her a blue sword named Gonturan that belonged to Lady Aerin, and Harry becomes known as the Damalur-sol, or lady hero.
Corlath decides to take a desperate stand against the Northerners with his small army and the nineteen King's Riders. First he chooses to visit the ageless seer known as Luthe, who tells Harry she has a choice ahead of her and that he hopes she will make the right decision. Luthe, like Corlath and Mathin, will tell her little of Aerin—but he surprises Harry with the observation that she is very like the ancient heroine, whom he'd known long ago. As the Riders discuss their battle plans, Harry points out that Corlath, still angry at the Homelanders, is ignoring the threat posed by a small pass near the Homelander border. He brushes her off, but Harry, torn between loyalty to her Homeland and a new-found love for Damar, knows the Homelanders will be better able to defend the pass if they are forewarned. Despite Corlath's direct orders to the contrary, she decides to leave and bring them word herself. While there, Harry learns from her friend Jack Dedham, that she and her brother are both part Damarian, through their great-grandmother on their mother's side of the family.
Harry amasses a small fighting force of friends and allies, both Damarian and Homelander. Together they attempt to hold the pass, only to find that Thurra is bringing the majority of his force through there, rather than where Corlath predicted. The two armies engage in a fierce, bloody battle. Harry briefly clashes swords with Thurra himself on the slope below the pass and barely survives; she knows that when they meet again, it will be her death. Harry, acting under the compulsion of her kelar, climbs the mountain, falling into a vision-laced trance, and calling for help from Aerin and Corlath. Harry begins shouting in the Old Tongue of the Hillfolk, and Gonturan throws off sparkling, eddying waves of light which cause the mountainside to shear and break away, rumbling into the valley below to crush Thurra and his army.
After she regains her strength, she returns to Corlath, fearing his disapproval—not only because she disobeyed his direct orders, but also because she lost the sash she wore as King's Rider. She knows that Corlath will be forced to honour her as the savior of Damar, but she is afraid that he will personally hate her for disobeying him and proving him wrong. Harry has realized that she is in love with the Damarian king, and desires not only his respect but his love.
While she has been gone, however, Corlath, aware that he has fallen in love with her, has been tormented by the thought that Harry had forsaken her loyalty to him and the desert entirely. When she returns from the pass they express these concerns to one another, and finally confess their love. During the celebrations after this public declaration, however, he reveals that her teacher, Mathin, has been mortally wounded. Distraught by the news, she rushes to his side and eventually Corlath helps her heal him, along with many other members of Corlath's army.
Upon returning to the capital city of Damar, Harry and Corlath are married. Harry's brother Richard, who chose to accompany her back to Damar, marries a Damarian woman named Kentarre the following spring. Harry and Corlath eventually have four children. During this time period, formal diplomatic relations open between the Homeland and Damar, in part due to Harry's efforts.