It sounds like a miracle, but no great technological leaps were required. In a commercial lab on the outskirts of Helsinki, I watched scientists turn water into food. Through a porthole in a metal tank, I could see a yellow froth churning. It’s a primordial soup of bacteria, taken from the soil and multiplied in the laboratory, using hydrogen extracted from water as its energy source. When the froth was siphoned through a tangle of pipes and squirted on to heated rollers, it turned into a rich yellow flour.

This flour is not yet licensed for sale. But the scientists, working for a company called Solar Foods, were allowed to give me some while filming our documentary Apocalypse Cow. I asked them to make me a pancake: I would be the first person on Earth, beyond the lab staff, to eat such a thing. They set up a frying pan in the lab, mixed the flour with oat milk, and I took my small step for man. It tasted … just like a pancake.

But pancakes are not the intended product. Such flours are likely soon to become the feedstock for almost everything. In their raw state, they can replace the fillers now used in thousands of food products. When the bacteria are modified they will create the specific proteins needed for lab-grown meat, milk and eggs. Other tweaks will produce lauric acid – goodbye palm oil – and long-chain omega-3 fatty acids – hello lab-grown fish. The carbohydrates that remain when proteins and fats have been extracted could replace everything from pasta flour to potato crisps. The first commercial factory built by Solar Foods should be running next year.

The hydrogen pathway used by Solar Foods is about 10 times as efficient as photosynthesis. But because only part of a plant can be eaten, while the bacterial flour is mangetout, you can multiply that efficiency several times. And because it will be brewed in giant vats the land efficiency, the company estimates, is roughly 20,000 times greater. Everyone on Earth could be handsomely fed, and using a tiny fraction of its surface. If, as the company intends, the water used in the process (which is much less than required by farming) is electrolysed with solar power, the best places to build these plants will be deserts.

We are on the cusp of the biggest economic transformation, of any kind, for 200 years. While arguments rage about plant- versus meat-based diets, new technologies will soon make them irrelevant. Before long, most of our food will come neither from animals nor plants, but from unicellular life. After 12,000 years of feeding humankind, all farming except fruit and veg production is likely to be replaced by ferming: brewing microbes through precision fermentation. This means multiplying particular micro-organisms, to produce particular products, in factories.I know some people will be horrified by this prospect. I can see some drawbacks. But I believe it comes in the nick of time.

Several impending disasters are converging on our food supply, any of which could be catastrophic. Climate breakdown threatens to cause what scientists call “multiple breadbasket failures”, through synchronous heatwaves and other impacts. The UN forecasts that by 2050 feeding the world will require a 20% expansion in agriculture’s global water use. But water use is already maxed out in many places: aquifers are vanishing, rivers are failing to reach the sea. The glaciers that supply half the population of Asia are rapidly retreating. Inevitable global heating – due to greenhouse gases already released – is likely to reduce dry season rainfall in critical areas, turning fertile plains into dustbowls.

A global soil crisis threatens the very basis of our subsistence, as great tracts of arable land lose their fertility through erosion, compaction and contamination. Phosphate supplies, crucial for agriculture, are dwindling fast. Insectageddon threatens catastrophic pollination failures. It is hard to see how farming can feed us all even until 2050, let alone to the end of the century and beyond.

Food production is ripping the living world apart. Fishing and farming are, by a long way, the greatest cause of extinction and loss of the diversity and abundance of wildlife. Farming is a major cause of climate breakdown, the biggest cause of river pollution and a hefty source of air pollution. Across vast tracts of the world’s surface, it has replaced complex wild ecosystems with simplified human food chains. Industrial fishing is driving cascading ecological collapse in seas around the world. Eating is now a moral minefield, as almost everything we put in our mouths – from beef to avocados, cheese to chocolate, almonds to tortilla chips, salmon to peanut butter – has an insupportable environmental cost.

But just as hope appeared to be evaporating, the new technologies I call farmfree food create astonishing possibilities to save both people and planet. Farmfree food will allow us to hand back vast areas of land and sea to nature, permitting rewilding and carbon drawdown on a massive scale. It means an end to the exploitation of animals, an end to most deforestation, a massive reduction in the use of pesticides and fertiliser, the end of trawlers and longliners. It’s our best hope of stopping what some have called the “sixth great extinction”, but I prefer to call the great extermination. And, if it’s done right, it means cheap and abundant food for everyone.

Research by the thinktank RethinkX suggests that proteins from precision fermentation will be around 10 times cheaper than animal protein by 2035. The result, it says, will be the near-complete collapse of the livestock industry. The new food economy will “replace an extravagantly inefficient system that requires enormous quantities of inputs and produces huge amounts of waste with one that is precise, targeted, and tractable”. Using tiny areas of land, with a massively reduced requirement for water and nutrients, it “presents the greatest opportunity for environmental restoration in human history”.

Not only will food be cheaper, it will also be healthier. Because farmfree foods will be built up from simple ingredients, rather than broken down from complex ones, allergens, hard fats and other unhealthy components can be screened out. Meat will still be meat, though it will be grown in factories on collagen scaffolds, rather than in the bodies of animals. Starch will still be starch, fats will still be fats. But food is likely to be better, cheaper and much less damaging to the living planet.

It might seem odd for someone who has spent his life calling for political change to enthuse about a technological shift. But nowhere on Earth can I see sensible farm policies developing. Governments provide an astonishing £560bn a year in farm subsidies, and almost all of them are perverse and destructive, driving deforestation, pollution and the killing of wildlife. Research by the Food and Land Use Coalition found that only 1% of the money is used to protect the living world. It failed to find “any examples of governments using their fiscal instruments to directly support the expansion of supply of healthier and more nutritious food.”

Nor is the mainstream debate about farming taking us anywhere, except towards further catastrophe. There’s a widespread belief that the problem is intensive farming, and the answer is extensification (producing less food per hectare). It’s true that intensive farming is highly damaging, but extensive farming is even worse. Many people are rightly concerned about urban sprawl. But agricultural sprawl – which covers a much wider area – is a far greater threat to the natural world. Every hectare of land used by farming is a hectare not used for wildlife and complex living systems.

A paper in Nature suggests that, per kilo of food produced, extensive farming causes greater greenhouse gas emissions, soil loss, water use and nitrogen and phosphate pollution than intensive farming. If everyone ate pasture-fed meat, we would need several new planets on which to produce it.

Farmfree production promises a far more stable and reliable food supply that can be grown anywhere, even in countries without farmland. It could be crucial to ending world hunger. But there is a hitch: a clash between consumer and producer interests. Many millions of people, working in farming and food processing, will eventually lose their jobs. Because the new processes are so efficient, the employment they create won’t match the employment they destroy.

RethinkX envisages an extremely rapid “death spiral” in the livestock industry. Only a few components, such as the milk proteins casein and whey, need to be produced through fermentation for profit margins across an entire sector to collapse. Dairy farming in the United States, it claims, will be “all but bankrupt by 2030”. It believes that the American beef industry’s revenues will fall by 90% by 2035.

While I doubt the collapse will be quite that fast, in one respect the thinktank underestimates the scale of the transformation. It fails to mention the extraordinary shift taking place in feedstock production to produce alternatives to plant products, of the kind pioneered in Helsinki. This is likely to hit arable farming as hard as cultured milk and meat production will hit livestock farming. Solar Foods thinks its products could reach cost parity with the world’s cheapest form of protein (soya from South America) within five years. Instead of pumping ever more subsidies into a dying industry, governments should be investing in helping farmers into other forms of employment, while providing relief funds for those who will suddenly lose their livelihoods.

Another hazard is the potential concentration of the farmfree food industry. We should strongly oppose the patenting of key technologies, to ensure the widest possible distribution of ownership. If governments regulate this properly, they could break the hegemony of the massive companies that now control global food commodities. If they don’t, they could reinforce it. In this sector, as in all others, we need strong anti-trust laws. We must also ensure that the new foods always have lower carbon footprints than the old ones: farmfree producers should power their operations entirely from low-carbon sources. This is a time of momentous choices, and we should make them together.

We can’t afford to wait passively for technology to save us. Over the next few years we could lose almost everything, as magnificent habitats such as the rainforests of Madagascar, West Papua and Brazil are felled to produce cattle, soya or palm oil. By temporarily shifting towards a plant-based diet with the lowest possible impacts (no avocados or out-of-season asparagus), we can help buy the necessary time to save magnificent species and places while these new technologies mature. But farmfree food offers hope where hope was missing. We will soon be able to feed the world without devouring it.

George Monbiot is a Guardian columnist. His film Apocalypse Cow is on Channel 4 at 10pm on Wednesday