Helen was born on 29 January 1750 to blacksmith Andrew Gloag and his wife Ann Kay in the village of Wester Pett, just south of Muthill in Perthshire, and was the eldest of four siblings. Her father remarried after her mother died, but Helen did not have a good relationship with her stepmother, and left home at the age of 19 to take a passage from Greenock to South Carolina. The ship was captured by Barbary corsairs, pirates from Morocco, two weeks into the voyage.
After capture, the men were killed and the women were taken to the slave market in Algiers. Gloag was purchased by a wealthy Moroccan and handed over to Sultan Sidi Mohammid ibn Abdullah. Due to her beauty, red hair, and green eyes, the Sultan added her to his harem. His infatuation toward her resulted in her becoming his fourth wife and eventually 'principal' or favourite wife, and later being given the title of Empress. Her intervention was said to be instrumental in the releases of seafarers and slaves captured by the Salé pirates.
Gloag was able to write home and to receive visits in Morocco from her brother Robert, who was responsible for her story finding its way back to Scotland. She became credited for a reduction in activities of Moroccan-based pirates, though this might also have been because of an increase in the number of English and French warships present due to the increasing tensions before the Napoleonic Wars.
Sultan Sidi Mohammid ibn Abdullah died in 1790 and his throne was seized by Mulai Yazeed, a son of the Sultan by another member of the harem. Yazeed consolidated his hold by killing any possible competition, including Helen's two sons. It is presumed that Helen was also killed during the following two years of unrest.
- The Fourth Queen By Debbie Taylor ISBN 1-4000-5376-5
- Perthshire in history and legend By Archie McKerracher ISBN 0-85976-223-8
- The biographical dictionary of Scottish women By Elizabeth Ewan, Sue Innes, Siân Reynolds, Rose Pipes
- The Thistle and the Crescent By Bashir Maan ISBN 1-906134-14-6
- A Gift for the Sultan by Olga Stringfellow
- Lowson, Stephen (29 May 2009). "Day of history to unfold in Muthill museum". Strathearn Herald. Retrieved 2009-06-23.
- "Helen Gloag: Undiscovered Scotland: The Ultimate Online Guide". Undiscovered Scotland. Archived from the original on 2007-10-21. Retrieved 2009-06-23.
- Bruce, Duncan A. (1998). The Mark of the Scots: Their Astonishing Contributions to History, Science, Democracy, Literature, and the Arts (illustrated, annotated ed.). Citadel Press. pp. page 182. ISBN 0-8065-2060-4. OCLC 9780806520605.
- Warner, Gerald (30 July 2007). "Helen of Morocco; Beauty: Helen Gloag, above, married the Emperor of Morocco after she was captured by corsairs". Daily Mail. Retrieved 2009-06-23.
- Gilchrist, Jim (20 February 2008). "Islam and us". The Scotsman. pp. paragraph 9. Retrieved 2009-06-23.
- Taylor, Debbie (2004). The Fourth Queen (reprint ed.). Random House. ISBN 1-4000-5376-5. OCLC 9781400053766.
- McKerracher, Archie (1988). Perthshire in history and legend. J. Donald. ISBN 0-85976-223-8. OCLC 9780859762236.
- Elizabeth Ewan, Sue Innes, Siân Reynolds, Rose Pipes (2006). The biographical dictionary of Scottish women. Edinburgh University Press.
- Maan, Bashir (2008). The Thistle and the Crescent (illustrated ed.). Argyll. ISBN 1-906134-14-6. OCLC 9781906134143.