The ruins lie silent and abandoned in the heart of the jungle; blocks of stone surrendered to the vines, which twist and writhe over temples, plazas and pyramids. Weeds and forest creatures have colonised the inner sanctums; mahogany and cedar trees swallow what once were roads, blotting out the sun. This is Tikal, the ancient Mayan city of northern Guatemala. There was a time when tens of thousands of people lived here. The architecture and urban planning - there are epic monuments, boastful inscriptions and even courts for playing ball games - embody boundless human confidence.

Today the only voices are of murmuring tourists, interlopers into a domain of spider monkeys and jaguars. "The imagination reels. There are reliefs, pyramids, temples in the extinguished city. The ... sound of flapping wings trickle into the immense sea of silence," wrote Miguel Ángel Asturias, Guatemala's Nobel laureate.

Shortly after its apogee, around AD800, the Mayan civilisation, the most advanced in the western hemisphere, withered. Kingdoms fell, monuments were smashed and the great stone cities emptied. Tikal now stands as an eerie embodiment of a society gone wrong, of collapse. How it came to pass is a question that has long fascinated scholars. Titles such as Ancient Maya: The Rise and Fall of a Rainforest Civilization fill faculty bookshelves. It has also provided fodder for literature and films, most recently Mel Gibson's Apocalypto. There is a grim, irresistible appeal to this tale of central American oblivion.

Recent events have injected a jarring note into Mayan studies: a sense of anxiety, even foreboding. Serious people are asking a question that at first sounds ridiculous. What if the fate of the Maya is to be our fate? What if climate change and the global financial crisis are harbingers of a system that is destined to warp, buckle and collapse?

No one is suggesting that vines will start crawling up the concrete canyons of Wall Street, or that howler monkeys will chase pin-striped bankers through Manhattan. Mayan kings who screwed up were ritually tortured and sacrificed with the aid of stingray spines to pierce the penis; an emphatic application of moral hazard. In our era, the only thing slashed is a bonus.

There are, however, striking parallels between the Maya fall and our era's convulsions. "We think we are different," says Jared Diamond, the American evolutionary biologist. "In fact . . . all of those powerful societies of the past thought that they too were unique, right up to the moment of their collapse." The Maya, like us, were at the apex of their power when things began to unravel, he says. As stock markets zigzag into uncharted territory and ice caps continue to melt, it is a view increasingly echoed by scholars and commentators.

What, then, is the story of the Maya? And what lessons does it hold for us? According to Diamond's thesis, this: the ancients built a very clever and advanced society but were undone by their own success. Populations grew and stretched natural resources to breaking point. Political elites failed to resolve the escalating economic problems and the system collapsed. There was no need for an external cataclysm or a plague. What did for the Maya was a slow-boiling environmental-driven crisis that its leaders failed to recognise and resolve until too late.

"Because peak population, wealth, resource consumption, and waste production are accompanied by peak environmental impact - approaching the limit at which impact outstrips resources - we can now understand why declines of societies tend to follow swiftly on their peaks," wrote Diamond in a 2003 article, The Last Americans: Environmental Collapse and the End of Civilization. The idea is expanded in his book Collapse: How Societies Choose to Fail or Succeed. The link between environmental, economic and political stress is clear, says Diamond. "When people are desperate and undernourished, they blame their government, which they see as responsible for failing to solve their problems."

A visit to the jungle ruins in the Yucatán peninsula, stretching from southern Mexico down to Guatemala, El Salvador, Honduras and Belize, is a humbling experience. There is sticky, sapping heat and squadrons of biting, stinging mosquitoes. The Maya were not a homogenous empire like the Inca or Aztecs but a series of squabbling kingdoms. The first settlements have been dated back to 1800BC but what is known as the "classic" period started much later, around AD250. The final period - zenith and collapse between AD750 and AD900 - is known as the "terminal classic".

Tikal, deep in the forest of Petén in northern Guatemala, was one of the Mayan capitals, a sprawling complex of limestone structures that was home to up to 100,000 people. Kings doubled up as head priests and political leaders. There were acropolises with hieroglyphs and pyramids with flat roofs from which astronomers and mathematicians mapped the planets and calculated calendars.

The Maya accomplished all this without pack animals - no cows, mules or horses to heave and push, just human muscle - and with limited water, which forced reliance on rainfall. By AD750 there were several million in the region, most of them farmers. Monuments and palaces became ever grander as kings and nobles competed for glory. And then everything went pear-shaped. Archaeological records show monument building abruptly stopped, as did the boastful inscriptions. There is evidence that palaces may have been burned.

Most dramatically, the population vanished. Over a few generations numbers withered from millions to tens of thousands, maybe even just thousands. Most abandoned the cities and migrated north. The birth rates of those who stayed tumbled. (Mathematically, Russia's population decline is on a similar trajectory). By the time Spaniards clanked into southern Yucatán in the 1500s there was hardly anyone left. Today, lush vegetation has reclaimed Tikal, turning everything mossy and green, but the temples, the tallest pre-Columbine structures, rise high over the canopy. George Lucas used Tikal as the site for the rebel base in the first Star Wars film.

To explain the mysterious collapse some scholars posit an invasion, or disease, or shifting trade routes, or a drought. There is wide agreement, however, that a leading cause was environmental pressure. "The carrying capacity of the ecosystem was pushed to its limits," says Marcello Canuto, an anthropology professor at Yale. Lakes became silted and soils exhausted. Tilling and man-made reservoirs provided more food and water but population growth outstripped technological innovation.

Complex and organised it may have been but Mayan society resembled a frog who stays in slowly boiling water, says Canuto. "Things were brewing within the system that were not picked up until too late." When the political elites did react they made things worse by offering greater sacrifices to the gods and plundering neighbours. "The kingdoms were interdependent and there was a ripple effect. They did not respond correctly to a crisis which, in hindsight, was as clear as day."

The environmental trouble built up over centuries and was partly concealed by short-term fluctuations in rainfall patterns and harvest yields. But when the tipping point came, events moved quickly. "Their success was built on very thin ice. Kings were supposed to keep order and avoid chaos through rituals and sacrifice," says David Webster, author of The Fall of the Ancient Maya. "When manifestly they couldn't do it people lost confidence and the whole system of kingship fell apart."

Which brings us to modern parallels. Webster, watching the season's first snowflakes through the window of his office at Pennsylvania State University, has been waiting for the question. Pinned to his wall is an old clipping about the fall of Enron Corporation in 2001. "That was the first tremor," he muses. "You know, human beings are always surprised when things collapse just when they seem most successful. We look around and we think we're fat, we're clever, we're comfortable and we don't think we're on the edge of something nasty. Hubris? No: ignorance."

Some anthropologists hesitate to make direct links between ancient and modern societies, deeming it out of academic bounds. Not Webster. "In common with the Maya, we're not very rational in how we think about how the world works. They had their rituals and sacrifices. Magic, in other words. And we also believe in magic: that money and innovation can get us out of the inherent limits of our system, that the old rules don't apply to us." He snorts.

This is a modish view these days but it was considered cranky luddism back during the 1980s stockmarket boom and the 1990s dotcom bubble. That was when masters of the universe bestrode Wall Street and Francis Fukuyama caught the triumphalist liberal economic zeitgeist with his book The End of History and the Last Man. That era, to borrow from Star Wars, feels a long time ago in a galaxy far, far away. Now Bear Stearns and Lehman Brothers are history and governments are taking over banks and propping up markets.

If traders and their mumbo jumbo about securitisation and derivatives resemble Mayan priests chanting in their temples then Bush and Gordon Brown are the hapless kings who egged them on rather than query the "magic". As chancellor, Brown blessed the conjuring. "In budget after budget I want us to do even more to encourage the risk-takers," he said in 2004. Now the frailty is revealed and instead of Gordon Gekko's "greed is good" we are hearing Shelley's Ozymandias: "Nothing beside remains. Round the decay/ Of that colossal wreck, boundless and bare/ The lone and level sands stretch far away."

Canuto sees an unhappy precedent. The Mayan kings who allowed their era's crisis to spin out of control were unfit to remedy it, not least because they were invested in the broken system. "The ones who caused the crisis are the ones you don't want trying to resolve it." Bush, by coincidence of timing, is on his way out but Britain's prime minister and other G8 leaders are hanging on.

Several commentators have argued that the financial crisis is but a squall compared with the ecological hurricane they say is coming. A European study estimates deforestation alone is causing a loss of natural capital worth between $2 trillion and $5tn annually. "The two crises have the same cause," wrote George Monbiot in the Guardian earlier this month. "In both cases, those who exploit the resource have demanded impossible rates of return and invoked debts that can never be repaid. In both cases we denied the likely consequences." With ecology the stock from which all wealth grows, the financial and environmental crises feed each other, says Monbiot.

If so, the Maya offer an ominous glimpse of what may lie in store. "Their population growth was like driving a car faster and faster until the engine blew up," says Webster, the anthropologist. "Look at us. I'm 65. When I was born there were two billion people in the world, now we're approaching seven billion. That's extraordinary." Eventually pressure on scarce resources will overwhelm technology - and do for us as it did for the Maya. "The western conceit is that we can have it all - and call it progress," says Webster. His voice drops. "I'm glad I'm not 30 years old. I don't want to see what's coming in the next 40 to 50 years."

Armageddon, like hemlines, is prone to changes in fashion. It has been on a roll with films such as 28 Days Later, I Am Legend and Blindness, which posit a world grimmer than anything Hobbes envisaged. Cormac McCarthy's post-apocalyptic novel, The Road, was hailed as an environmental fable. "By day the banished sun circles the earth like a grieving mother with a lamp," he writes, before introducing baby-skewering cannibals. That too is being made into a film. Webster does not think things will get that bad. "Not like Mad Max," he says, managing to sound almost cheery. "But definitely unpleasant."

The gloom may be misplaced. Reports of capitalism's death have been exaggerated before and it has stubbornly survived Karl Marx, the Great Depression, world wars and oil shocks. And in contrast to the Maya, it is possible our technology will prevail over population and environmental pressures. Malthusian doomsayers have consistently underestimated the capacity of better irrigation, pesticides, new strains of crops and other technologies to boost food yields. The rate of population growth is slowing and human numbers are expected to peak at around 9.2 billion by 2050 before declining. That Asians are moving more and more to western-type diets and consumer baubles will strain resources, acknowledges the Economist. But don't worry: "There is no limit to human ingenuity."

If the gloomy environmental prognosis is correct, and global warming is set to wreak major havoc, what are the chances we will respond better than the Maya? Electing Bush instead of Al Gore suggests limited wisdom in picking kings, and emasculating the Kyoto treaty was perhaps as sensible as burning corn harvests to appease the gods. When Republicans chant, "Drill, baby, drill!" it is not much of a stretch to picture them, barefoot and in traditional huipil shirts, rooting for another sacrifice.

Nevertheless there are promising omens. Governments are beginning to assign monetary values to natural "assets" such as forests, a conceptual leap that could reinvent economics. The EU has set up a carbon-trading market to get industry to cut greenhouse gas emissions. The UN is pushing for a new climate treaty in which governments will pay tropical countries billions of dollars annually to leave their forests untouched. Ecuador has already requested $350m a year in exchange for leaving 1bn barrels of oil beneath its Amazon floor. "I believe the 21st century will be dominated by the concept of natural capital, just as the 20th was dominated by financial capital," says Achim Steiner, head of the UN environment programme.

Even so, would that be enough? Civilisations rise - and collapse - for many different reasons. If there is a simple lesson to be drawn from central America's abandoned ruins it is to protect the environment and control population growth, says Michael Coe, author of the seminal 1966 text, The Maya. "No civilisation lasts for ever. Most go for between 200 and 600 years." The Maya, Romans and Angkor of Cambodia lasted 600.

And us? "Western civilisation began with the Renaissance, so we're hitting 600 years," says Coe. "The difference is we have a choice whether to let things get worse or fix them. That's what science is about. But it takes will on the part of those who govern and those who are being governed." Coe, one of the world's leading experts on civilisation collapse, pauses. "To tell you the truth, I don't know if we have that."