THERE are several candidates for the title of the most famous town in Scotland – Ayr with its links to Robert Burns, Paisley as the largest town in Scotland in terms of population, or perhaps Arbroath as home of that famous declaration of independence in 1320.

Yet on a global basis I think you would be hard-pressed to find any Scottish town more famous than St Andrews. Whether as the Home of Golf, or as the location of the nation’s oldest university, or the place where the current Prince and Princess of Wales met, St Andrews has numerous claims to fame.

Since golf is played across the world by tens of millions of people who surely all know the importance of St Andrews, on the basis of sheer numbers alone, St Andrews is our most famous town.

The National: The University of St Andrews, with the University’s Department of Film Studies is a key partner

I am grateful to the University of St Andrews (above), many St Andrews societies, and St Andrews Museum as sources for this piece. And I particularly acknowledge Electric Scotland’s online publication of the 1893 work St Andrews by one of Scotland’s greatest historians Andrew Lang (1844-1912). Lang has a series of lectures at St Andrews University named in his memory and he is buried at St Andrews Cathedral.

At the beginning of his book, Lang points out that the rise of St Andrews was “assuredly not due to its situation”. By that he meant its location in the north-east of Fife, with a bay but no natural harbour, and stuck on a promontory between the firths of the rivers Tay and Eden. Yet there must have been something to draw early incomers to the area, immigrants from the Continent who came to Scotland over thousands of years.

Archaeological finds have indicated that the area was settled by incomers in prehistoric times around 4500 BCE. They were farmers, mostly, as woodlands were cleared, and they seem to have made the place a permanent base, though it was so inconsequential that the invading Romans appear to have passed it by during their intrusions into the lands north of the Forth and Clyde.

READ MORE: The town where two of Scotland's greatest military calamities happened

As with so many of our ancient towns, the advent of Christianity saw St Andrews develop as a township. How that actually happened is something which historians still argue about, but it is known that by the middle of the first millennium, the area had become a centre of the Pictish tribe or tribes and was later known as Kilrymont.

According to one legend, the Bishop of Patras in Greece, St Regulus or Rule, was in charge of the remains of St Andrew, the first Apostle called by Christ. Regulus was told in a dream by an angel that the Roman Emperor Constantine was coming to Patras to take away the saint’s relics, so he should escape to the ends of the Earth. Regulus took with him several consecrated virgins – St Triduana among them – and various bits of St Andrew and sailed as far west as he could go.

Whether accidentally or deliberately, he landed at Kilrymont and preached Christianity to the Picts, thus “founding” St Andrews as instructed by the angel.

In some versions, St Regulus was met by the Pictish king Oengus, who adopted St Andrew as his patron. The only problem with those accounts is that St Regulus lived in the fourth or fifth century, while Oengus dates to the 700s.

The truth is we do not really know exactly how the relics of the saint got here, or even if they really were St Andrew’s arm bone, kneecap and teeth. But there is no doubt they were venerated as such by the growing number of Christians in that part of Scotland. Kilrymont becoming St Andrews suggests that pilgrimages had begun.

The cult of St Andrew was given a considerable boost when a king of the Picts called Angus mac Fergus had a dream.

Let the Scottish Saltire Trust tell the story: “In the year 832AD, an army of Picts under Angus mac Fergus, High King of Alba, and aided by a contingent of Scots led by Eochaidh, King of Dalriada, had been on a punitive raid into Northumbrian territory and were being pursued by a large force of Angles and Saxons under one Athelstan.

“The Scots/Picts were caught by their pursuers near the present-day village of Athelstaneford in East Lothian. Fearing the outcome, King Angus led prayers for deliverance, and was rewarded by the dramatic appearance above the fighting of a white Saltire, the diagonal cross on which St Andrew had been martyred, against a blue sky.

The National: Saltire

The king vowed that if, with the saint’s help, he gained the victory, then Andrew would thereafter be the patron saint of Scotland. The Scots/Picts did win, and in due course the St Andrew’s Cross would become the flag of Scotland.”

It was also very good news for the town of St Andrews, where a lucrative pilgrimage trade was developing. The new patron saint’s reputation as a miracle worker also helped grow the town.

AS happened in many places in Scotland at the end of the first millennium, the Culdees had taken control of Christianity in Fife, and these men – either saintly monks associated with St Columba, or hermits who had wives and their own version of Christian rites, or both – now had charge of the all-important relics of the saint.

King Oengus is supposed to have built a monastery for them and made it the centre of a bishopric, while one of his successors, King Constantine, built a new church for the Culdees.

In the latter half of the 11th century, there was growing conflict between the Culdees and the clerics who wanted the faithful to follow practices decreed by Rome. Queen Margaret – later Saint Margaret – favoured the latter and since her husband was the powerful warrior King Malcolm III (Canmore), she got her way.

READ MORE: 'Isle of the foreigners': The Viking roots of the ancient town of Stornoway

She had a particular fondness for praying to St Andrew and ordered a new ferry service across the Forth to assist pilgrims on their way to St Andrews – that’s how Queensferry got its name.

But it was one of her sons, King Alexander I, who really boosted St Andrews. Knowing of his mother’s great devotion to the town, Alexander decided to make it his principal bishopric and brought in an English cleric, Turgot of Hexham, to be its bishop in 1107. He founded the church which later became the parish of the Holy Trinity and established a priory for monks.

The problem for Alexander was that the archbishops of Canterbury and York both claimed to be the Pope’s representative for the whole of the north of Britain, and they demanded the right to appoint any future bishop of St Andrews. Alexander was not happy with that, and in 1124 he appointed Robert, the abbot of the Augustinian foundation at Scone, as bishop.

Alexander died before Robert could be consecrated and, according to Andrew Lang, to please the new king, the powerful and pious David I, Archbishop Thurston of York consecrated the new bishop in 1128, thus establishing the independence of the Scottish church. Without further ado, Robert set about building a tower, possibly linked to a small basilica, dedicated to St Regulus or Rule.

St Rule’s Tower remains a feature of the town’s skyline and is in the care of Historic Environment Scotland, which re-opened it to the public last year after a repair project.

The bishopric of St Andrews became a much-disputed office with subsequent kings appointing their own men to the post. The various bishops built the cathedral over a period of 150 years, and one of them, Bishop Roger, built St Andrews Castle from the year 1200. Confirmed as the administrative centre of the church in Scotland, St Andrews flourished and grew, with its burgh of barony status helping to make it an important trading post.

The National: St Andrews Castle

The most famous Bishop of St Andrews was William Lamberton at the time of the Wars of Independence. His support for Robert the Bruce was vital to the rise of the king and it cost him some time in captivity in England after Lamberton supervised the Bruce’s crowning at Scone in 1306.

Despite being technically excommunicated, the king attended the dedication of the cathedral which Lamberton finished in 1318. More than a century later, it suffered a disastrous fire and it took until 1488 for it to be rebuilt.

Before that, a momentous event took place in the town with the foundation of Scotland’s first university. It grew out of a loose association of learned clerics and masters, most of them educated in Paris, who knew that Oxford and Cambridge were not hospitable to Scots after the long wars. They came together to give lectures and lessons in a town which we know already had schools and scholars and had done so from the 12th century.

In 1411, Bishop Henry Wardlaw sanctioned the charter which, according to the university website, “granted the masters and students recognition as a properly constituted corporation, duly privileged and safeguarded for the pursuit of learning”. Wardlaw, with the support of King James I, asked Pope Benedict for university status for the new institution and the Pope readily agreed, issuing no fewer than six papal bulls in 1413.

READ MORE: 'Mad, bad, and dangerous': The Scottish background of the English romantic poet

The university is still ranked among the world’s best, and to this day the Roman Catholic Church has the Archdiocese of St Andrews and Edinburgh. St Andrews remained the headquarters of the church in Scotland until the time of the Reformation in which the town had a pivotal role.

It is a compelling story which places St Andrews right at the heart of the history of the Scottish Reformation, and I will tell that amazing tale next week with a second column on St Andrews which will feature the likes of Cardinal David Beaton; Mary, Queen of Scots; the Protestant martyrs such as George Wishart; and the extraordinary figure of John Knox.

As I wrote earlier, the global fame of St Andrews largely rests on its deserved reputation as the Home of Golf, so the following week’s column will complete the history of this ancient town by telling how Scotland, and particularly St Andrews, gave the world the great sport of golf.

Later in the year I will also show how Scotland devised other sports and I will recount the history of curling, the Highland Games, shinty and one of our greatest inventions – modern football. England claimed that football was “coming home” at the European Championship in 1996. I will show how that claim was only half true. St Andrews getting three columns? Told you it was our most famous town …

If you have suggestions for inclusion in this series on Scotland’s ancient towns, email me at nationalhamish@gmail.com. Towns must have been established before 1560, have to have played a part in the history of Scotland, and their history has to have been thoroughly researched.