It’s exactly a century since Mata Hari was executed by a French firing squad, having been convicted of spying for Germany. To put it another way, it’s exactly a century since the Dutch dancer and courtesan was reborn as a legend. The first biography of her was published in 1917, just weeks after her death, and since then she has been the subject of 250 biographies and novels, along with a slew of stage shows, television series and films – most notably a 1931 biopic starring Greta Garbo. 

The qualities that made her embody sex, glamour, intrigue and danger got her executed

And those are just the books, films and shows which are officially about Mata Hari. There are at least as many whose siren-spies are clearly inspired by her, even if they have different names. Dishonored (1931) had Marlene Dietrich as a Mata Hari type. One recent academic article categorises Notorious and North by Northwest as ‘Hitchcock’s Mata Hari films’ for their inclusion of female spy characters who use sex to get the job done. And the trailer for next year’s Red Sparrow, featuring Jennifer Lawrence as a Russian agent who is “trained to seduce and manipulate”, is just the latest retelling of the myth.

- The Lady Gaga of the 1920s

- The most copied pop star of all time?

- How an African figurine changed art

If the majority of these portrayals are crazily inaccurate, there is a certain justice in the extent to which Mata Hari’s life story has been twisted and embellished, because she did some of that twisting and embellishing herself. “She was a creation from beginning to end, a character in a play that she continuously rescripted,” says Pat Shipman in her biography of Mata Hari, Femme Fatale. Her compulsion to spin tall tales about her background helped to make her an icon: a unique embodiment of sex, glamour, intrigue and danger. But it also led to her death in October 1917, at the age of 41.

It was a compulsion she inherited from her father, Adam Zelle, a hat-shop owner in the Dutch town of Leeuwardne, who rejoiced in his grandiose nickname: The Baron. He encouraged his daughter Margaretha to be as flamboyant as he was, but her spoilt childhood ended abruptly in her early teens, when her parents divorced and her mother died. Lodging with relatives, Margaretha enrolled in a teacher-training college, but was rumoured to be having an affair with the headmaster. She was thrown out; the headmaster kept his job.

Sex sells

In need of money and respectability, she answered a newspaper lonely-hearts ad from a soldier who was home on leave from the Dutch East Indies (today’s Indonesia). Aged 18, Margaretha met the 39-year-old Rudolf MacLeod at the Rijksmuseum in Amsterdam in 1895. They announced their engagement six days later. But the role of obedient wife was one she found impossible to play. After the couple moved to the island of Java, where MacLeod resumed his military duties, he fumed about his bride’s interest in fashion and gossip – even though marriage hadn’t curtailed his own habitual drinking and womanising. He doted on their son, Norman, and their daughter, Non, but he abused Margaretha, verbally and physically. When Norman died, their short marriage effectively died with him. 

Back in the Netherlands, the MacLeods divorced in 1902. Margaretha was awarded custody of Non, but, with no money of her own, she had no choice but to leave her daughter with her ex-husband and find another new role to play. Once again, she had to rely on her wits, her dark-eyed good looks and her formidable sex appeal to survive.  Having moved to Paris, she worked as an artist’s model and a circus equestrian before a friend suggested that she try dancing in a salon for an audience of novelty-seeking culturati. Another friend came up with the name Mata Hari, the Malay words for ‘eye of the day’, ‘rising sun’, or ‘dawn’ – and a new day dawned for her.

Mata Hari was an immediate sensation, not least because her daringly sensual dancing involved throwing off the veils she was wearing, one by one, until she was naked but for a jewelled head-dress and breast-plate. If this taboo-busting display wasn’t enticing enough by itself, she insisted that she was demonstrating authentic Javanese temple-dancing, so audiences could tell themselves that they weren’t paying to see a striptease, but an educational glimpse of a religious ritual from ‘the mysterious East’.

“She was seen as the nude of art, rather than the nude of commerce,” says Julie Wheelwright, the author of The Fatal Lover: Mata Hari and the Myth of Women in Espionage. “Because she started off in private salons rather than music halls, she had respectability. And because Isadora Duncan and others were reinventing dance by borrowing not just from the classics but from other dance traditions, her performances were seen as a cultural event.”

Crucially, she played the role of Mata Hari off stage as well as on. She told some journalists that she had been born in Java to European parents, and others that she was the daughter of an Indian temple dancer. “Mata Hari personifies all the poetry of India,” gushed a review in Le Journal, “its mysticism, its voluptuousness, its languor, its hypnotising charm.”

As well as being the toast of Belle Époque Paris, she toured Berlin, Vienna, Monte Carlo and Milan. And she had no shortage of high-society lovers to keep her in the style to which she was becoming accustomed. When war broke out, then, it wasn’t entirely illogical for the German consul in Amsterdam to offer her 20,000 francs to steal French secrets. After all, she spoke several languages, she travelled around Europe and she was intimate with numerous officers, politicians, aristocrats and industrialists. Who better to hear what the great and the good were saying behind closed doors?

A woman of affairs

Georges Ladoux, head of the French counter-espionage bureau, agreed. He proposed that Mata Hari spy for France, and she accepted, neglecting to mention that she had already accepted a similar offer from the enemy. She was either brilliantly cunning or stupidly naive. Most Mata Hari scholars believe she was the latter.

“She had always been fantastically good at reinventing herself,” says Julie Wheelwright. “She had pulled off the incredible coup of reinventing herself as Mata Hari. But what she didn’t understand was that if she reinvented herself again during the War, and played the role of a spy, the stakes would be much higher. It wasn’t the game and the performance that she thought it was.”

She did so little in the way of actual spying that some biographers doubt whether she should be classified as a spy at all. “If indeed she was a spy,” writes Pat Shipman in Femme Fatale, “Mata Hari surely ranks among the world’s most inept agents... She sent uncoded letters to Ladoux through the ordinary mail; she telegraphed him openly, she called at his office repeatedly... she was recognised everywhere, known everywhere, and was inevitably the centre of attention... What chance had such a woman of being a successful spy, much less a double agent?”

A famous secret agent is almost a contradiction in terms. But Mata Hari’s combination of subterfuge and celebrity explains why so many fictional spies are indebted to her. James Bond is essentially a gender-switched Mata Hari, not just because he is a serial seducer who revels in his luxurious, globe-trotting lifestyle, but because he is indiscreet enough to announce his name wherever he goes.

So much for fiction. In reality, no one who treated espionage as a glittering entertainment could last long, and Mata Hari was arrested on the charge of being a double agent in February 1917. The French authorities had hardly any evidence, but the country’s wartime losses had been so devastating that, for the sake of national morale, somebody had to take the blame. Mata Hari’s prosecutor in her court martial, Pierre Bouchardon, focused not on her deeds, but on her character: she was liberated, licentious, international, prone to rewriting her past. Never mind that these attributes had made her a star in peace time. In a war, they were enough to condemn her. 

For decades afterwards, Mata Hari was held up as the archetypal temptress: the she-devil who proved that sexually confident women deserved to be punished. But feminist critics have reclaimed her as someone who prospered in a man’s world by being creative and determined enough to will a new identity into being. Even after 100 years and 250 books, though, we still don’t know everything about her movements or her motives. The veils keep coming off, but the tease isn’t over yet.

If you would like to comment on this story or anything else you have seen on BBC Culture, head over to our Facebook page or message us on Twitter.

And if you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Culture, Capital and Travel, delivered to your inbox every Friday.