Maged Shamdy's ancestors arrived on the shores of Lake Burrulus in the mid-19th century. In the dusty heat of Cairo at the time, French industrialists were rounding up forced labour squads to help build the Suez Canal, back-breaking labour from which thousands did not return. Like countless other Egyptians, the Shamdys abandoned their family home and fled north into the Nile Delta, where they could hide within the marshy swamplands that fanned out from the great river's edge.

As the years passed, colonial rulers came and went. But the Shamdys stayed, carving out a new life as farmers and fishermen on one of the most fertile tracts of land in the world. A century and a half later, Maged is still farming his family's fields. In between taking up the rice harvest and dredging his irrigation canals, however, he must contemplate a new threat to his family and livelihood, one that may well prove more deadly than any of Egypt's previous invaders. "We are going underwater," the 34-year-old says simply. "It's like an occupation: the rising sea will conquer our lands."

Maged understands better than most the menace of coastal erosion, which is steadily ingesting the edge of Egypt in some places at an astonishing rate of almost 100m a year. Just a few miles from his home lies Lake Burrulus itself, where Nile flower spreads all the way out to trees on the horizon. Those trunks used to be on land; now they stand knee-deep in water.

Maged's imperial imagery may sound overblown, but travel around Egypt's vast, overcrowded Delta region and you hear the same terms used time and again to describe the impact climate change is having on these ancient lands. Egypt's breadbasket is littered with the remnants of old colonisers, from the Romans to the Germans, and today its 50 million inhabitants jostle for space among the crumbling forts and cemeteries of those who sought to subjugate them in the past.

On the Delta's eastern border, in Port Said, an empty stone plinth is all that remains of a statue of Ferdinand de Lesseps, the man who built the Suez Canal; somewhere along the Delta's westernmost reaches, the long-lost tomb of Cleopatra lies buried. With such a rich history of foreign rule, it's only natural that the latest hostile force knocking at the gates should be couched in the language of occupation.

"Egypt is a graveyard for occupiers," observes Ramadan el-Atr, a fruit farmer near the antiquated town of Rosetta, where authorities have contracted a Chinese company to build a huge wall of concrete blocks in the ocean to try to save any more land from melting away. "Just like the others, the sea will come and go – but we will always survive."

Scientists aren't so sure. Two years ago, the Intergovernmental Panel on Climate Change declared Egypt's Nile Delta to be among the top three areas on the planet most vulnerable to a rise in sea levels, and even the most optimistic predictions of global temperature increase will still displace millions of Egyptians from one of the most densely populated regions on earth.

The Delta spills out from the northern stretches of the capital into 10,000 square miles of farmland fed by the Nile's branches. It is home to two-thirds of the country's rapidly growing population, and responsible for more than 60% of its food supply: Egypt relies unconditionally on it for survival. But with its 270km of coastline lying at a dangerously low elevation (large parts are between zero and 1m above sea level, with some areas lying below it), any melting of the polar ice caps could see its farmland and cities – including the historical port of Alexandria – transformed into an ocean floor. A 1m rise in the sea level, which many experts think likely within the next 100 years, will cause 20% of the Delta to go underwater. At the other extreme, the 14m rise that would result from the disappearance of Greenland and western Antarctica would leave the Mediterranean lapping at the northern suburbs of Cairo, with practically all of the Delta underwater.

Already, a series of environmental crises are parking themselves on the banks of the Nile. Some are subtle, like the river's quiet vanishing act in the Delta's northern fields; others, like the dramatic collapse of coastal lands into the ocean, are more striking. Major flooding is yet to become a reality but, from industrial pollution to soil salinity, a whole new set of interconnected green concerns is now forcing its way into Egyptian public discourse for the first time.

"The Delta is a kind of Bangladesh story," says Dr Rick Tutwiler, director of the American University in Cairo's Desert Development Centre. "You've got a massive population, overcrowding, a threat to all natural resources from the pressure of all the people, production, pollution, cars and agricultural chemicals. And on top of all that, there's the rising sea. It's the perfect storm."

Follow the Nile north out of Cairo on the old agricultural road, and you find it hard to pinpoint where the city ends and the lotus-shaped Delta begins. Carpeted with redbrick apartment blocks and spliced with streets in every direction, the lush greenery of the Nile's splintered arteries is almost impossible to appreciate in isolation. This is where the urban and the rural get lost in each other, with livestock living in doorways and workers camping out in fields. In the past, literary giants venerated the Delta's wild marshlands; today, any clear-cut divisions between the metropolis and the countryside have long faded away.

Urban encroachment – the steady chipping away at arable land through unauthorised construction – haunts the Delta everywhere you look. Despite a web of legislation outlawing illegal building practices and theoretically "fencing off" agricultural land, in every direction the sweeping vista of wheat fields and rice paddies always ends abruptly in a cluster of half-built homes. There are more than 4,000 people per square mile in the Delta; it's hard to think of any other place where humans and the environment around them are more closely intertwined. With Egypt's present-day population of 83 million set to increase to more than 110 million in the next two decades, the seemingly unstoppable spread of bricks and mortar over the soil is both the most visible symptom of the country's demographic time-bomb and an inevitable response to it.

More people in the Delta means more cars, more pollution and less land to feed them all on, just at a time when increased crop production is needed most. Yet the desertification of land through human habitation is, worryingly, only the beginning of the problem. Although few in the Delta have noticed it yet, the freshwater of the Nile – which has enabled Egypt to survive as a unified state longer than any other territory on earth – is creaking under the strain of this population boom. The world's most famous river has provided the backdrop to all manner of dramas throughout history, real and fictional. Now, around its northernmost branches where the minarets and pylons thin out and the landscape becomes more windswept, another is playing out to devastating effect.

The villain is salinity. I visit one of the worst-affected regions, Kafr el-Sheikh, on a Friday morning when the fields have emptied out for the noon prayer. The streets are eerily silent; with its people gone, the area takes on the appearance of one of Italo Calvino's fantastical string cities, chock-a-block with the shells of human habitation but no living souls remaining. The exception is Maged, who owns six feddan (about six acres) of land near the village of el-Hadadi.

Maged is halfway down a hole when I approach his house. Clambering out apologetically, he explains that German experts visited this area last year and declared that the fresh water being pumped to local villages "wasn't fit for a dog to drink". After months of phone calls to the national water company, none of which were answered, Maged decided to lay down a new set of pipes himself in the hope it would improve the quality of drinking water for his two young daughters. It's hot, exhausting work, which he fits in between his farming duties and a new part-time job as an accountant in a local alfalfa plant. "We don't have much time on our hands at the moment," Maged says, dusting himself off and gulping down some fresh melon juice. "Nobody can make a living solely off the land any more."

On a tour of his fields, I see why. The rich brown soil has greyed out in recent years, leaving a barren salt-encrustation on the surface. The cause is underground saltwater intrusion from the nearby coast, which pushes up through the soil and kills off roots. Coastal farmland has always been threatened by saltwater, but salinity has traditionally been kept at bay by plentiful supplies of fresh water gushing over the soil and flushing out the salt. It used to happen naturally with the Nile's seasonal floods; after the construction of Egypt's High Dam in the 70s (one of the most ambitious engineering projects on earth), these seasonal floods came to an end, but a vast network of irrigation canals continued to bring gallons of fresh water to the people who worked the land, the fellahin, ensuring salinity levels remained low.

Today, however, Nile water barely reaches this corner of the Delta. Population growth has sapped its energy upstream, and what "freshwater" does make it downriver is increasingly awash with toxins and other impurities. Farmers such as Maged now essentially rely on waste water – a mix of agricultural drainage and sewage – from the nearby town of Sidi Salim.

The result is plummeting fertility; local farmers say that whereas their fathers spent just a handful of Egyptian pounds on chemicals to keep the harvests bountiful, they now have to put aside between 25 and 80% of their profits for fertilisers just to keep their crops alive.

"We can see with our own eyes that the water is no good, it's less and less pure," Maged says. He points out huge swaths of neighbouring land that once glimmered with rice paddies; recently they have been dug up and replaced by fish farms, the ground too barren for crop cultivation. Further out, in the village of Damru, the green fields of 10 years ago are cracked and brown, now put into service as informal football pitches and rubbish dumps.

Experts believe the problem is only going to get worse. "We currently have a major water deficit in Egypt, with only 700 cubic metres of freshwater per person," explains Professor Salah Soliman of Alexandria University. "That's already short of the 1,000 cubic metres per person the UN believes is the minimum needed for water security. Now, with the population increase, it will drop to 450 cubic metres per person – and this is all before we take into account the impact of climate change."

That impact is likely to be a 70% drop in the amount of Nile water reaching the Delta over the next 50 years, due to increased evaporation and heavier demands on water use upstream. The consequences of all these ecological changes on food production are staggering: experts at Egypt's Soils, Water and Environment Research Institute predict that wheat and maize yields could be down 40% and 50% respectively in the next 30 years, and that farmers who make a living off the land will lose around $1,000 per hectare for each degree rise in the average temperature.

The farmers here feel abandoned by the state; there are regular dismissive references to the "New Age", a euphemism for the much-hated regime of President Hosni Mubarak, whose neoliberal reform programmes and widespread corruption scandals have provoked a wave of popular discontent across the country. This disconnect between the state and its people has led to distrust of government scientists who think coastal erosion, rather than freshwater scarcity, is the main reason for the farmers' problems. And, in a worrying twist for Egypt's creaking economy, the erosion isn't only affecting farmers. "Unfortunately, most of our industry and investment has been built on sites very close to the shore," says Soliman. "There's only so much water we can hold back."

Ras el-Bar is a small holiday resort at the mouth of the Nile's Damietta branch. This was the summer paradise that Nobel prizewinning novelist Naguib Mahfouz's well-heeled characters would escape to when the heat of the capital became unbearable; today its squat pink lighthouse and endless boulevards of deserted, low-rise holiday homes have the faded feel of a 50s Disneyland.

Although still popular in July and August, Ras el-Bar has been overtaken as a seaside destination by the brash consumerism of a new generation of towns: Sharm el-Sheikh, Marina, Hurghada. In place of tourists, however, new factories have arrived here in abundance, including some that nearby residents believe are poisoning the air. The arrival of one industrial plant in Damietta, which coincided with the ministry of environment's last-minute decision not to designate the area a protected nature reserve, is a familiar story of shady backdoor deals, public outrage and the studious disregard of local opinions. In this case, the locals managed to postpone the factory's construction, but other plants remain. "In the morning here you can see nothing but smoke," says Mohammed Fawzia, who is fishing in a canal down by the side of an industrial complex run by the state-owned Mopco company. "Take photos of it for us so we can show who is killing our children. We want the factories gone."

Many Cairo-based experts, however, insist that the task of coping with the dramatic ecological changes faced by the Delta is made harder by the ignorance of people such as Mohammed. They claim the fellahin are too uneducated to change their ways. But they are wrong: while farmers in the southern Delta, where Nile water is still relatively plentiful, have little knowledge of climate change, those in the north are painfully aware of the science behind the death of their land. However, they also have little time to listen to the harrying of a government which is widely seen to preach green rhetoric on the one hand but is only too willing to sell out the environment on the other, along with the local people.

Money talks in Egypt, and sustainable development is forgotten when the interests of the rich and powerful – such as the industrial plants in Damietta or the influential Badrawi clan in Daqahliyah – are at stake. The repression and self-interest of Mubarak's inner circle have left them bereft of any moral authority on environmental issues.

And while scientists, academics and community organisers are making a concerted effort to educate Egyptians about the dangers of climate change, there is confusion over whether the focus of all these programmes should be on promoting ways to combat climate change, or on accepting climate change as inevitable and instead encouraging new forms of adaptation to the nation's uncertain ecological future.

Efforts are further hampered by a popular feeling that this is a crisis made by the west. "We're not responsible for climate change," says Soliman, pointing out that Egypt's contribution to global carbon emissions is an underwhelming 0.5%, nine times less per capita than the US. "But unfortunately the consequence of climate change is no respecter of national borders."

The scale of the crisis – more people, less land, less water, less food – is overwhelming, and has infected discussion of climate change with a toxic combination of cynicism and fatalism at every level. There are senior environmental officials in top scientific jobs here who do not believe climate change is real; others are convinced the problem is so great that human intervention is useless. "It's down to God," one environmental officer for a major Delta town tells me. "If the Delta goes we'll find new places to live. If Egypt was big enough for Mary and Joseph, then it will be big enough for all of us."

Of course, if sea levels do rise significantly, "then the debate is over," says Dr Tutwiler. "The land will be underwater and crop production will be over."

As a result, many now believe that Egypt's future lies far away from the Delta, in land newly reclaimed from the desert. Since the time of the pharaohs, when the Delta was first farmed, Egypt's political leaders have rested their legitimacy on their ability to feed it by taming the Nile. Mohammed Ali, Lord Cromer and Gamal Abdel Nasser all launched major projects to control and harness the river's seasonal floods; now Mubarak is following in their footsteps – not by saving the Delta, but by creating a bewildering array of canals and pumping stations that draw water out from the Nile into sandy valleys to the east and west, where the desert is slowly being turned green.

You can see evidence of these new lands on the Delta's fringes; mile upon mile of agri-business-owned fields peeking out behind the advertising billboards of the Cairo-Alexandria desert road. The billboards depict gated compounds and luxury second homes, escapist dreams for the Egyptian upper-middle class.

The new lands behind them are another sort of escape, this time for the whole country. Their very water-intensive existence is, though, only hastening the demise of the Delta; once the glittering jewel of Egypt and bedrock of its survival, but now a region whose death warrant may already have been signed.

Invasion of the Nile: The Delta's troubled history

• 4,000 – 3,000 BC approx – The Delta is populated by migrants from the Sahara and intensive farming begins in the region

• 1,300 BC approx – According to the Bible, the Delta is home to the Israelites, and miraculously survives God's plague of hail

• 343 BC – The Persians kill Egypt's last native pharaoh, ushering in more than 2,000 years of foreign rule over the Delta

• 332 BC – Alexander the Great invades and founds Alexandria at the tip of the Delta

• 30 BC – Cleopatra and Marc Anthony kill themselves

• 639 AD – Muslim Arabs sweep into the Delta, forcing out the Byzantine rulers

• 1517 AD – The Delta is absorbed into the Ottoman Empire and ruled from Turkey

• 1798 AD – Napoleon Bonaparte begins a three-year French occupation

• 1805 AD – The Albanian pasha Muhammad Ali seizes power but his dynasty falls under the control of the British Empire

• 1952 AD – Gamal Abdel Nasser restores Egyptian rule for the first time in two millennia

• 1970 AD – The Aswan Dam is completed, ending seasonal flooding in the Delta

• 2007 AD – Delta declared among top three areas vulnerable to rising sea levels

Alexandria: An ancient city under threat

Alexandria has been through several reincarnations: as a small Pharaonic town in the 4th century BC, as the capital of Egypt for 1,000 years, and as a cosmopolitan melting-ground in the early 20th century. While most of its former glories are already lying on the seabed, scientists now fear the city's outer fringes could be among the first victims of any rise in sea levels.

A rise of only 1m will leave the city centre cut off from the mainland. If it does disappear, its literary chroniclers may provide some comfort. Lawrence Durrell called it "the capital of memory", a city where recollections stay "clinging to the minds of old men like traces of perfume upon a sleeve". The Greek poet Constantine Cavafy shared Durrell's sense of being trapped by history. In what may prove a remarkable piece of foresight, he wrote in The City:

You'll find no new places, you won't find other shores.

The city will follow you. The streets in which you pace

will be the same, you'll haunt the same familiar places,

and inside those same houses you'll grow old.

You'll always end up in this city. Don't bother to hope

for a ship.