WHEN, IN THE early morning of October 15, 1917, M'greet Zelle, alias Mata Hari, walked toward the executioner's stake in Paris' Bois de Vincennes, swung stylishly about as if at the end of the ramp in a fashion parade and blew a teasing kiss at the firing squad before collapsing in a tumble of skirts, 16 bullets in her body, the French government crowed that it had executed history's greatest woman spy. This legend quickly took hold in a public eager to find something -- anything -- even remotely intriguing or romantic about that four-year slogging match which leveled empires and sacrificed a generation of young men in the trenches of the Western Front. The first film on Mata Hari appeared in 1922, when the ink was hardly dry on the Versailles Treaty. By 1932, Greta Garbo played the famous spy to packed cinemas.

Journalist Russell Howe, who is the first to gain access to Mata Hari's sealed file, ironically preserved in the French War Archives just yards away from the spot where she was shot, concludes that the Mata Hari spy legend is just that. In fact, her courageous, even heroic exit was perhaps her most successful role. The woman executed by the French, Howe concludes, was their own agent, and not a very good one at that.

Until her execution in 1917, nothing in M'greet Zelle's career would seem to mark her down for anything but an obscure footnote in the history of belle epoque Europe. The daughter of a Dutch hatter whose ostentation and poor management led him into bankruptcy, M'greet drifted into a desperately unhappy marriage with a captain in the Dutch colonial army. After her son was poisoned by a disgruntled Indonesian servant who apparently put cat whiskers in the curry, she fled to Paris at the age of 27, where her attempts to launch a career as an artist's model foundered because her breasts were judged insufficiently voluptuous -- after this, she was to keep them covered even in the most intimate moments, explaining to her multitude of lovers that her brutish husband had bitten off her nipples.

Her dark good looks and audacity allowed her to convince a dilettantish turn of the century salon society that she was a Hindu princess, Mata Hari (meaning "the light of day" in Malayan), who possessed a repertoire of exotic temple dances. That her performances were little more than a poorly executed strip tease hardly mattered to the upper class males who jostled to discover what other little tricks she had learned in the temple. From 1905 to the outbreak of war, she danced less and made love more, frittering away her substantial fees and gifts in ostentatious living. By 1917, it must have become apparent even to this silly, scatterbrained woman, already a frumpish 40, that her days of bedding dukes and princes were nearing an end, and that she would probably finish her career servicing a clientele of rustics in some obscure provincial bordello unless she could do something spectacular to restore her fortunes.

Indeed, it was this realization which caused her to offer her services to French espionage, in the naive belief that Paris would pay handsomely for secret information harvested on the pillows of German officialdom, money which would allow her to retire in style with her young Russian paramour. In this way, she triggered a series of circumstances which would lead to her early death. The Germans, already furious with Mata Hari for taking 20,000 francs from them and giving nothing in return, leaked information that she was their spy. The French chose to believe these spurious messages for reasons not entirely clear. The file of Captain Georges Ladoux, the gray eminence of Mata Hari's execution, remains closed, but Howe speculates that Ladoux sought to boost his lackluster military career by a spectacular spy coup. MATA HARI's court martial justified in full measure the once popular observation that military justice is to justice what military music is to music. However, in the dark days of 1917, after the enormous bloodletting of Verdun, the failure of the Nivelle offensive on the Chemin des Dames, and with Russia in the process of dissolving into revolution, it is unlikely that any court could have resisted pressure to select a scapegoat. So, the ageing courtesan was offered up in expiation for the millions of young men who had already perished in the war. In retrospect, it is tempting to suppose that Mata Hari might not have been unhappy with the way things turned out, for although Captain Ladoux failed to salvage his military career, he certainly rescued a prostitute from her slide into historical obscurity.

Douglas Porch, who teaches history at The Citadel, is the author of "The Conquest of Morocco" and "The Conquest of the Sahara."