An Andalusian shepherd boy named Santiago consults a Gypsy fortune-teller about the meaning of a recurring dream. The woman interprets it as a prophesy, telling the boy that he will discover a treasure at the Egyptian pyramids.
After Santiago sets out, he meets an old king named Melchizedek, or the king of Salem, who tells him to sell his sheep so as to travel to Egypt and accomplish his 'Personal Legend'. Early on his arrival in Africa, a man who claims to be able to take Santiago to the pyramids robs him instead of the money he had made from his flock. Santiago then has to work for a crystal merchant so to earn enough to get to the pyramids.
Along the way, the boy meets an Englishman who has come in search of an alchemist and continues his travels with his new companion. When they reach an oasis, Santiago meets and falls in love with an Arabian girl named Fatima, to whom he proposes marriage. She promises to marry him only after he completes his journey. Frustrated at first, he later learns that true love will not stop nor must one sacrifice one's destiny to it, since to do so robs it of truth.
The boy then encounters a wise alchemist, who teaches him to realize his true self. Together, they risk a journey through the territory of warring tribes, where Santiago is forced to demonstrate his oneness with "the soul of the world" by turning himself into a dust storm before he is allowed to proceed. When he begins digging within sight of the pyramids, he is robbed yet again, but accidentally learns from the leader of the thieves that the treasure he sought was all along in the ruined church where he had his original dream.