Early on the morning of 19 August 1561, two galley ships sailed beneath the cliffs of the Berwickshire coastline and, skirting the islands of the Forth of Forth, turned towards the Port of Leith. The oars dipped and lifted in unison, the crew sweating as they cut through the water. One ship was white, the other red; both flew French flags. A thick summer haar cloaked the harbour. Reaching the dockside, they pulled in the oars and dropped anchor.

The small but busy port was startled by the blasting of the ships’ cannons. It was not a declaration of war but a salute to the woman on board, arguably the most important figure the country had ever welcomed back. She was Mary Stuart, Queen of Scotland, finally returned after an absence of 13 years. Before setting foot on shore, she must have peered into the mist, wondering what sort of message this murky, damp beginning held for her long-awaited and long-overdue homecoming.

There had been omens enough. Five days earlier, when she and her entourage embarked from Calais, she witnessed a grim scene at the harbour mouth. A fishing boat had been rammed by another vessel and sank with all crew on board. Mary begged the captain of her galley to save them, but the boat dragged the men down with it. The sea had barely closed over them when her flotilla made for open water. “What a sad augury for a journey!” she said.

Because her ships had sailed so swiftly, Mary arrived in Scotland much earlier than expected. There was no great crowd, and certainly no officials, to form a welcome party on the quayside. But, by the time the court at Holyroodhouse had been alerted, and she set off in a procession up Leith Walk to the Palace, she was already creating a sensation. Even the man who was to become her fiercest critic, the scholar George Buchanan, conceded that “she was graced with surpassing loveliness of form.”

That day, and for several years to come, she was in mourning for her late husband, the King of France, as were her ladies in waiting. Their white-and-black dress code was strikingly French and chic and, for one of Mary’s auburn hair and pale complexion, flattering too. Given her unusual height – she was approaching six feet tall – she was the embodiment of nobility. Many who saw her much have believed that the misery that had followed the battles of Flodden and Solway Moss, and the bitter conflict during her absence, were finally ended.

Had they paused to reflect that a mere 12 months earlier the established church had been overthrown, to be replaced with an iron brand of Protestantism, they might have had an inkling of what lay ahead. Then again, it is probable that a great many of the cheering crowd were still Catholic at heart, and hoped their queen would turn back the religious clock.

When Mary returned to her homeland, she was only 18. Newly widowed, she had come home to take up her throne, though not without hesitation. The prospect must have been daunting: this was somewhere she had not seen since she was sent for safety to France aged five. When she landed in Leith, she was effectively arriving in a foreign country. It was also a nation in political as well as religious turmoil.

In the years that followed, Mary’s initial popularity drained away as she made one bad decision after another. These miscalculations eventually led to her forced abdication, and her flight into England, to seek her cousin Elizabeth I’s help. But, as every schoolchild and film-goer knows, instead of helping her to regain her throne, Elizabeth had her imprisoned. Mary’s claim to the English throne was strong, and as a possible focal point for Catholic rebellion, she was a thorn in Elizabeth’s side. Even so, her eventual execution, after 19 years, was also in part because of Mary’s rash behaviour.

Without a doubt, the roots of Mary’s tragic end lie in her years as Queen of Scotland. A career that started with popular acclaim ended in tatters. To this day, a tantalising question hangs over her: was she the author of her own misfortunes, or should Scotland bear some – or much – of the blame?

In hindsight, Mary’s downfall looks almost inevitable, yet there was nothing predictable about any of it. She was intelligent and charismatic and, even if she knew too little of her homeland, she had been educated in what would be expected of her as monarch. The problem was, those who taught her – her Guise uncles – were French, and the rules of the French court were very different from those in Scotland.

Throughout her reign, Mary lacked the close, trustworthy councillors all monarchs require. Her half-brother, the Protestant reformer James Stewart, Earl of Moray, was working against her interests almost from the start. So were others, who were far more brutal and venal. As she soon learned, she was surrounded by courtiers whose allegiances shifted like the tide.

Despite this, Mary might have kept her footing had she not made a disastrous second marriage. Against all advice, including that of her maids-in-waiting, she married Henry Stuart, Lord Darnley. Good looking, elegant and fashionable (“more like a woman than a man” one diplomat recorded), he soon proved to be drunk, debauched, and not just vile but vicious. By the time Mary was heavily pregnant with her first child, Darnley had been persuaded that she was having an affair with the Italian singer and secretary, David Rizzio, with whom she would sit up late playing cards (while her husband was enjoying the city’s fleshpots). That Rizzio kept privy councillors at a distance from the queen, acting almost as a go-between, made him universally loathed.

If you want to imagine what it was like to be a royal in the 1560s, Rizzio’s murder spells it out. At seven o’clock on the evening of Saturday, 9 March, 1566, Mary was having supper in her rooms with friends and supporters. It was Lent, but because she was pregnant she was allowed to eat meat. The small supper room off her bedchamber in Holyrood Palace was lit with candles, and the mood was convivial when Lord Darnley entered and, sitting beside Mary, put an arm around her waist. There was no hint of what was about to happen until the curtain at the doorway was pulled aside and the alarming figure of Lord Ruthven, dressed in a full suit of armour, stepped inside the room. Pale as wax, in part because of ill health and the effect of moving beneath a second skin of steel, he denounced Rizzio for preventing Darnley from gaining the Crown Matrimonial, a powerful title Darnley was desperate to win.

Others rushed into the room behind him, brandishing swords and daggers. Since he was cowering behind the queen, the first blow Rizzio received was thrust into him across Mary’s shoulder. The blade passed so close to her throat that she felt the coldness of the steel. In the confusion, the table with its dishes and glasses was overturned, but the candlestick was rescued by the Countess of Argyll, and lit the scene. Darnley held Mary firm, preventing her from struggling. As Rizzio was dragged out, a pistol was pressed into her stomach. It was an act she never forgot or forgave.

Mary was right in immediately recognising the threat to her own life, and that of her unborn child. That such a heinous, treasonable act could take place in the sanctuary of her private rooms, with the support of some of the country’s leading men, shows how terrifyingly violent and volatile this era was. It makes House of Cards look like Blue Peter.

Is it any wonder that when, less than a year later, Darnley was found murdered, Mary was widely assumed to have been in on the plan? To this day it remains unclear whether she was fully aware of the plot, or guessed what was afoot but chose to turn a blind eye. Entire innocence is hard to credit. Yet even if she had been a willing party to the killing, it might not have spelled the end of her reign.

What happened next, however, was fatal for her reputation. The ringleader of the events that led to Darnley’s death was widely believed to be James Hepburn, Earl of Bothwell, one of her staunchest supporters. An educated thug from the Borders, he had his eye on marrying Mary, and ditched his wife (who didn’t complain) as soon as that seemed possible. An investigation into Darnley’s killing that exonerated Bothwell was so obviously a whitewash that the public mood swiftly turned against the Queen, who many thought had been having an adulterous affair with her husband’s murderer.

There is no evidence for that, but following Darnley’s death, Mary seems to have lost her wits. She showered gifts on Bothwell, and was often seen in his company. Worst of all, she agreed to marry him, despite – or perhaps because – he very probably raped her. Was this an act of madness? More likely it was desperation, but she had gone too far. Her wedding day, when she wept as if recognising the almighty mistake she had made, could be seen as the nadir of her reign.

Military defeat at Carberry Hill by her enemies, who had styled themselves the Confederate Lords, was followed by a year’s incarceration in Lochleven Castle. During that unhappy period, she miscarried twins and, unforgivably, was forced to abdicate against her will while still gravely unwell. During these dragging months, public opinion began slowly warming towards her once more.

Mary’s storybook escape from her island prison might have signalled the resetting of her reign, but once again she made a terrible decision. After defeat at the Battle of Langside at the hands of her half-brother Moray, she insisted on fleeing to England. Wearing borrowed clothes, and with her head shaved, she later wrote that she and her posse spent “three nights living like the owls” – riding under cover of darkness, and sleeping by day, for fear of capture.

On the afternoon of 16 May, 1568, she prepared to set sail across the Solway Forth from Port Mary Cove to Cumbria, confident that in a few months she would be retuning at the head of a large army. Wiser political heads knew this was wishful thinking. One of her companions, watching her ride into the water towards the boat, grabbed her bridle and made a last attempt to change her mind. But it was set, as was her miserable future.

On this, and earlier occasions, Mary lacked the strength of character and strategic intelligence necessary to control and assess her situation. Yet this calamity was not all her doing. It was her misfortune, if that is the right word, to come home to a country immeasurably altered from the one she left as a child. Could anyone in her position have held back the remorseless progress of Protestantism, which made the situation for a Catholic monarch alarmingly precarious? Were her rebellious Protestant lords wrong in embracing this more egalitarian, democratic and potentially republican doctrine?

Mary might have behaved impeccably, and the outcome remained the same. She was caught between the rock of religious reform and her claim to the English throne. Ultimately she died because that claim was solid.

For Scotland, this was of secondary importance so long as Elizabeth remained on the throne. The country needed a ruler with the guile and gravitas to weld its competing and warring factions together, and to resist pressure from the forces beyond, foremost England and France. It needed someone with qualities of leadership, political courage and integrity at the helm. While she possessed elements of each, which in less tumultuous times would have sufficed, Mary was too easily thrown off course or wrong-footed. In that sense she was like a tree that was planted in the wrong season, whose roots remain shallow and loose.

To paraphrase the novelist Ford Madox Ford, Mary’s is one of the saddest stories ever heard. There have been far less capable and considerably more malign kings and queens who kept their crowns and their heads. She had some remarkable qualities, but they were barely allowed expression in the cauldron of the Reformation, whose forces were ultimately too strong for her.

From the start, she was out of her depth. On balance, the disastrous events of her time on the throne can be traced back to poor decisions she made, including those allies she chose blindly to trust. Had she been brought up in Scotland, she might have known enough of how its people thought and lived to stay a step ahead of events; as it was, she was always one behind. Facing down men who had brought about a revolution required equal if not greater strength, and this she did not possess. Mary’s homecoming was the definition of tragedy.

Homecoming; The Scottish Years of Mary, Queen of Scots is published by Birlinn, £22

SEVEN PLACES WHERE MARY MADE HISTORY

Linlithgow Palace

Mary was born in a small room overlooking the loch below. It is thought that her mother, Marie of Guise, gave birth prematurely after learning how ill her husband, James V, had fallen after the Battle of Solway Moss. On his death, Mary became Queen of Scotland at six days old.

Stirling Castle

She spent her early years here, with her mother, in the sumptuous new and renovated apartments, built by her father and grandfather, James IV. It was one of the safest royal castles, protecting her from Henry VIII, who wanted to marry her to his son.

Palace of Holyroodhouse

Mary’s main residence during her reign, but a place she never liked. It was in her supper room, in the James V Tower, that Rizzio was dragged out and murdered in her public reception room, leaving a pool of blood from 56 stab wounds.

Edinburgh Castle

Mary gave birth to James VI in a tiny chamber, where there was room only for her maids, midwife and cradle. The castle was chosen as a well-guarded location, but Darnley’s night-time excursions meant the gates were often opened after dark.

Mary Queen of Scots House, Jedburgh

An old fortified house, possibly the original where Mary stayed in the autumn of 1566, and nearly died. She grew so ill, it was thought she was gone, and windows were opened to release her departed spirit, until her physician found a way to revive her. The house now holds a museum and various artefacts and belongings associated with her.

Lochleven Castle

Scene of her almost year-long imprisonment, and forcible abdication. Escape seemed impossible until a young relative of the castle’s owner devised an audacious plan.

Dundrennan Abbey

Mary spent her last night on Scottish soil here, writing to Elizabeth I for help. After fleeing the Battle of Langside, she could not get out of the country fast enough. A boat arrived at the cove a mile from the abbey from which she sailed away.