Since her execution on the outskirts of Paris almost a century ago, the Dutch exotic dancer Margaretha “Gretha” MacLeod – universally known as Mata Hari – has been synonymous with female sexual betrayal. Convicted by the French of passing secrets to the enemy during the first world war, MacLeod’s prosecutors damned her as the “greatest woman spy of the century”, responsible for sending 20,000 Allied soldiers to their deaths. MacLeod’s status as both a foreigner and a divorcee, who was unrepentant about sleeping with officers of different nationalities, made her a perfect scapegoat in 1917.

Gretha’s wedding photograph … ‘She passed from the hands of a caddish father into the hands of a caddish husband.’ Photograph: © Bornmeer-Tresoar The Netherlands.

When MacLeod is remembered, it is never as a mother. But, to coincide with the 2017 centenary of her death, a Dutch publisher has released an astonishing cache of her letters, which reveal the hitherto unseen maternal side of her character. Edited by Lourens Oldersma, they chronicle her struggle to establish a new life with her daughter after leaving an abusive marriage. Without financial support, however, she faced the brutal choice of poverty or taking, as she described it, “the road to perdition”.

“The letters make her much more human,” says Yves Rocourt, curator of an upcoming exhibition on Mata Hari at the Fries museum in her hometown of Leeuwarden. “You’ve got to admire her for continuing to rebuild her life after it crashes down.” Rocourt, whose exhibition will feature artefacts from MacLeod’s early life, says her ability to overcome tragedy and to reinvent herself, a very modern concept, is central to understanding her character. “She’s a strong woman, no matter what you think about her actions.”

She was born Margaretha Geertruida Zelle into a prosperous family in the capital of Friesland, Holland, in 1876. Despite her father’s relative wealth as the owner of a millinery shop, his speculation in oil shares ended in financial disaster and, penniless, he departed for the Hague. Her mother died when Gretha was only 15 and she was sent to live with relatives, away from her twin brothers. At 18, she responded to a lonely hearts ad in a newspaper and, four months later, was married to Rudolph “John” MacLeod, who was almost twice her age and a hard-drinking officer in the East Indies army. According to a relative, “she passed from the hands of a caddish father into the hands of a caddish husband”.

From the start, her marriage was troubled. After the birth of their son, Norman, in 1897, they sailed for the Dutch East Indies, where Gretha would spend four years living in military garrisons. After the birth of their daughter, Non, in 1898, tragedy struck. For reasons that remain a mystery, a nanny poisoned Norman and Non; he died, she barely survived. Although John was able to retire on a military pension in 1900, the couple were unhappy and returned to Holland. Two years later, they separated.

Until now, biographers’ only access to Gretha’s writing has been the interrogation transcripts leading up to her espionage trial in 1917 and her prison letters held in the French military archives. The new collection, Don’t Think That I’m Bad: Margaretha Zelle Before Mata Hari (1902-1904), reveals that this so-called “maneater” who danced at La Scala in Milan, the Opera in Paris and private salons across Europe actually had an active dislike of sex. “My own husband has given me a distaste for matters sexual such as I cannot forget,” she wrote, confirming that, while in the Dutch East Indies, she had contracted syphilis from John and, as a precaution, Non was subjected to mercury treatment.

Mata Hari … ‘My husband has given me a distaste for matters sexual.’ Photograph: Heritage Images/Getty Images

Gretha and John separated in 1902 and she was granted custody. But when he refused to pay the legally agreed allowance, she wrote to his cousin, Edward, who acted as an intermediary. The correspondence reveals her desperation to keep her daughter but, without family connections and with most professions barred to women, she had few choices. She reluctantly returned Non to her father and left for Paris. “I thought all women who ran away from their husbands went [to Paris],” she later said.

Once settled into her new life, but “yearning for Nonnie”, she wrote again to Edward, explaining that her husband’s suggested reconciliation was impossible because of his abusive behaviour. “One Sunday afternoon, crazed and deranged, he came close to murdering me with the breadknife,” she wrote. “I owe my life to a chair that fell over and which gave me time to find the door and get help.” According to Gretha, John suffered from what one doctor called tropical frenzy and “others called ‘sadism’”.

Without Non, she felt lost. “I can get by well here in Paris,” she wrote, “but I am abstaining from everything for my child (so far). In the event that I am certain of never again being able to have her with me as her mother, then I shall care no longer and shall cast everything aside.” She tried every means to earn money respectably, giving piano lessons, teaching German, applying to work as a ladies’ companion and as a model a department store. Less respectable, but more lucrative, was sitting as an artist’s model for Montmartre painters such as Edouard Bisson, Octave Denis Victor Guillonnet and Fernand Cormon, where she made important theatrical contacts.

Poignantly, in the last letter in this collection, written on 28 March 1904, Gretha had returned temporarily to Holland, but was contemplating suicide after missing “my child, my house, my comfort”. She had secured a temporary lifeline, a part in a play with a theatre company, but confessed to sleeping with men for money. “Don’t think that I’m bad at heart,” she told Edward. “I have done it only out of poverty.”

As the centenary of Mata Hari’s execution approaches, there are signs of renewed interest in her story, with Paulo Coehlo’s recently released novel The Spy, Ted Brandsen’s new ballet by the Royal Dutch Ballet, and next year’s exhibition at the Fries museum. Perhaps the letters, offering a more human side to this woman, as a victim of domestic abuse and historical circumstances, may finally vanquish the historical slut-shaming of Mata Hari.

Julie Wheelwright is the author of The Fatal Lover: Mata Hari and the Myth of Women in Espionage