They stand as witnesses to a bygone age, when Paisley was a great economic success story, and home to a global industry, red sandstone monuments to wealth and patronage in a town that has witnessed the best of times and the worst of them.

The library, observatory, town hall and memorial church remain magnificent structures, erected to reflect the glory of international commerce and the wealth that came with it. This was a town built by thread.

Most of Paisley’s notable civic buildings were funded by the families behind J&P Coats, which by 1910 had become the third biggest corporation in the world, behind only Standard Oil and US Steel.

Here was a business that ran two enormous mill complexes in its hometown, employing more than 12,000 Paisley buddies, while building similar operations worldwide, from North and South America to Russia, Africa and the Indian sub-continent. That global expansion ultimately contributed to the downfall of Paisley, but it sustained a significant presence – and thousands of jobs – for most of the 19th and 20th centuries. Its history traces that of the Industrial Revolution, and its impact on Scotland reflects the country’s rise and fall as a key economic player of the period.

Even today Coats is a giant, employing 19,000 people in 60 countries, but only a handful of administrators in Scotland, none of them making thread.

The Coats story has its roots in the Renfrewshire weaving and textiles industry. Two Paisley families, the Coats and Clarks, were rival manufacturers of silk thread. When the French blockaded Britain during the Napoleonic Wars in 1806, cutting off silk supplies, the challenge was to find alternative raw materials. The ingenious Scots turned to cotton. The decision transformed the industry for ever.

“Many people tried to make a cotton sewing thread, but with no success for years. The Clarks were the brilliant family and they made the breakthrough,” explains Brian Coats, the great-great-great grandson of the company founder, who worked in Colombia and other parts of the world for the business over many years. Now retired in California he has authored a company history.

For decades the two companies continued as rivals. The Clarks built their first integrated mill, Anchor, on the east side of Paisley in 1817, and the Coats followed suit with their first proper mill at Ferguslie in 1826. Although the Clarks were acknowledged to be the innovators, they were reputedly something of a dysfunctional family business. They were competing with the Coats, who were endowed with far better organisational and management skills. Ultimately the two came together in 1896, a move that looks more like a takeover than a merger, as the enlarged business retained only the J&P Coats name.

The second big breakthrough for Paisley’s burgeoning thread makers was the development of the mass-produced sewing machine. Throughout the 19th century, such machines became more sophisticated, affordable and near-ubiquitous. It is hard to imagine the modern age without it, from industrial processes to clothing. It is forgotten often that you can’t sew without thread. Created originally to supply the weaving industry, now J&P Coats sold thread directly to a burgeoning market of consumers. It came to dominate the market worldwide.

Andrew Coats, a trained lawyer, travelled to the United States and aggressively protected the company’s patents there, while his engineer brother Thomas ran the business back home. The siblings, second generation of the family business, transformed Coats into a giant of the industry.

By the 1850s the US had begun slapping heavy tariffs on all sorts of imported goods, including thread. The Scots’ response was to set up manufacturing in the eastern US itself. That in turn sparked a massive growth that took their ingenuity for thread-making across the globe.

Clarks set up in New Jersey and Coats at Pawtucket, Rhode Island. The buildings at Pawtucket Mill, a near-identical copy of Ferguslie, remain mostly intact today, although it ceased manufacturing operations decades ago. Within 20 years the American businesses had proved to be hugely successful, and prompted further international expansion, across the continents. “Basically the United States became a kind of cash register for the wider organisation,” says Professor Sam McKinstry, of the University of the West of Scotland, who has studied the history of Coats.

“It is one of the very first industrial, multinational companies. Yes, there is East India Company and so on, which are essentially trading companies, but Coats was manufacturing overseas from a very early stage,” says Nick Kuenssberg, a well-known figure in Scottish business who was recruited from university and made his reputation as a successful young Coats manager.

The J&P Coats of the late 19th and early 20th century was a patriarchal business. Coats built a school for its workers, and a social club. It employed thousands, including generations from local families. As it expanded, it sent workers and managers around the world, to help set up new thread-making facilities, and even to run them. Before the Great War and the Russian revolution, Coats was running factories in the US, China, Russia and all over central and eastern Europe. Before the Second World War broke out, the company employed 35,000 people worldwide.

Various operations in Russia and the Baltic states were lost after the revolution. Many more in Poland, Germany and Austria were requisitioned by the Nazis during the lead-up to the war. One family tale is typical: Willie Jamieson was a cost accountant sent out to oversee Coats’ businesses in Bratislava and Vienna, when the Germans marched into the Austrian capital, where his family were living.

On the day Hitler arrived to receive an exultant Austrian welcome, an anxious Jamieson headed home to gather up his family and make a hasty exit. “My mum and dad packed everything they could and fled,” recounts his son, Ken Mathieson. “They drove through the streets ahead of Hitler’s procession and the streets were thronged with thousands of people. They were driving down the route of the motorcade just in time to get away with it.”

Business recovered quickly after the war. Coats regained production capacity that had been commandeered by the Nazi occupying powers across Europe. The company set about continued expansion, especially in Latin America and India. A stream of managers were sent to places such as Peru and Venezuela, India and Pakistan. New market opportunities were popping up all the time; it seemed the good times would continue to roll as new consumers in emerging economies fed demand for thread.

But it wasn't to last.

Many of the former staff still meet up at annual lunches and other social events to share their memories of working for J&P Coats.

What was it like to work for Coats in Paisley? There were strict demarcations in the mills. The vast majority of work was done by women – Paisley’s famous “mill girls” – who made up most of the shop floor on every “flat”, or storey, of the massive mills. Here was a community of people, working where their mothers had worked, and hoping their daughters would work there too.

Fridays were happy days, when the mill girls got their hair done in the grand, well-appointed mill toilets. All human life was there. “The atmosphere in the place was brilliant. When it came the weekend we were all ready to go out, finish on a Friday,” recalls Isa Erroch. “We went to the cloakroom, we were getting our hair done, our eyebrows plucked and rollers in, all ready for the weekend experience, the dancing and all that. It was great.”

June Quail, another former mill girl, adds: “There was such a lot of dance halls in Paisley. Wherever you went there was always a mill girl.” She recalls learning dance steps in the mill loos before heading up to Glasgow for a night at the Barrowland. Braver girls would enter the communal toilets with a potato and a needle, seeking help to get their ears pierced.

Company archive film from the 1960s and 70s depict a busy workforce but also one with a strong sense of community. Many women, such as the “doffers” whose job was to gather spools of thread from the spindles when they were fully wound, were on piece work. They were paid according to how much work they did. Many worked night shift. Their children would come home from school, be given their tea and cajoled into starting their homework, before Mum would get her coat on and head off to the mill. The wages these women earned gave them significant financial independence, or contributed significantly to their family upkeep. During the Depression of the 1930s, female mill workers were the main bread-winners, as male unemployment soared.

Then there was the noise. Workers recall the mills as places where many used a form of lip-reading in order to communicate above the din of the massive machines. “We had to turn our backs on the supervisor, as very often they could lip-read too,” laughs former worker Ann Lightbody. They worked amid row upon row of machines, manipulating thousands of miles of cotton through the various processes. The mill complexes covered every element of the manufacturing process, including dyeing and spooling.

So how and when did it all go wrong? Older hands blame the firm’s decision to move away from developing its managers from the shop floor. During the 1970s it recruited graduates into management. However good they were at business, they lacked sentiment and knew nothing about the way Coats had been run in its heyday.

The mills themselves were antiquated, both complexes dating back more than 150 years by the time the crunch came during the late 1970s. In 1983, the death knell sounded for Ferguslie. Some staff transferred to Anchor, but most lost their jobs. Suddenly Paisley – second only to oil-rich Aberdeen for high employment a decade earlier – was in the doldrums, with worse to come.

In a sense, Paisley paid the price for Coats’ continuing international success. For years, the Paisley mills had provided the backbone of the business, their profit funding expansion into new markets. But many of those markets were closer to the raw materials, with much lower labour costs. It made business sense to manufacture there. The problem for Paisley was that by the time its costs were rising and productivity falling, its mills were so old that they could not claim an economic case for investment.

Coats had tried to stem the decline over many years. Acquisitions of smaller textiles companies such as Viyella or Patons and Baldwins undoubtedly helped. But these actions could not avert closure in Paisley. In many respects Coats, the first multinational giant based in Scotland, was to set the standard for industrial decline across the Central Belt.

“I handed over the cheques to a lot of them. One day I remember it was about 40 men out of a dye works. You knew a lot of them would never get a job. You went home and felt like hitting your head off a wall,” remembers Eleanor Clark, former personnel manager.

Ten years after Ferguslie, its workforce diminished to a few hundred, Anchor Mill closed too, bringing thread manufacture to an end for Paisley after two centuries.

Local people remember working in the industry with great fondness. Its departure brought new emotions, of despair and hopelessness. June Quail remembers crying as she watched demolition begin at the Ferguslie site. “With it all getting pulled down, I think Paisley people felt pulled down too. My dad said, ‘Well, it’s all downhill now.’”

For Paisley, the way back has been a long, tortuous experience. The loss of Coats followed the closure of the car plant at Linwood, and many others. Braehead and Silverburn shopping malls sucked the life from Paisley town centre. Much of Ferguslie is housing now. It regularly comes top of an ignominious league, that of socio-economic failure. There is a strong sense of injustice about the way Paisley has suffered at the hands of the global economy, a sense that has driven the town’s bid to spark regeneration by becoming UK City of Culture in 2021, a goal it shares with Perth.

Says McKinstry, “I’ve been coming to Paisley for nearly 30 years to work, and I get a very intense feeling of something old, venerable and useful having gone."

Maurice Smith is executive producer of The Town That Thread Built, a documentary to be broadcast on BBC Two on June 7 at 9pm.