Andy Piper was worried about the Houses of Parliament. Not what goes on inside them, but the buildings themselves — the ornate debating chambers and wood-paneled rooms where the business of the United Kingdom’s legislative body goes on. As design director for Parliament’s restoration program, it was part of Piper’s job to alert lawmakers to the state of the houses of state. So in summer 2017, he took the then-leader of the House of Commons, Conservative lawmaker Andrea Leadsom, on a tour of the building’s darkest and most ignored corners.

Piper hoped to show Leadsom a few fire hazards and maybe an unsafe cable or two. As the cabinet member responsible for organizing government business, she could draw more attention to the issue. But when he unlocked the door to the parliamentary basement, the stench hit them both. Raw sewage was oozing down the corridor from a burst pipe. “We couldn’t walk all the way through the basement,” Leadsom, now business secretary, recalls to TIME. “We had to go back and enter from the other end.” Far from being embarrassed by the incident, Piper was overjoyed. “It was very convenient for us,” he remembers. “She probably thought we had set it up.”

The Palace of Westminster, as the estate is formally known, is in a sad state. Its facade looks ornate from a distance, but up close it’s held together only by the grime of decades. In the basement, Victorian-era pipes carry pressurized steam just inches away from high voltage electric cables. Asbestos lines the walls. Staff upstairs count getting trapped in elevators as an occupational hazard. Most of the building’s nearly 4,000 bronze-framed windows don’t close properly, letting warm air out and cold rain in. The alarm system is so unreliable that at least two wardens patrol the building looking for fires, day and night, all year round. Even the gilded chambers where lawmakers sit aren’t immune from decay. In April, a debate in the House of Commons was cut short by water leaking from the ceiling. That day, the upkeep team was lucky. On bad days, the leaks come instead from the 130 year-old sewage system.

The bare exposed wiring of the aging phone system underneath the Palace of Westminster in London. Ben Quinton for TIME Scaffolding and tarpaulin erected above recently renovated and cleaned brick work on the Palace of Westminster, with the London Eye behind. Ben Quinton for TIME

Lawmakers have known about the growing risk since the Second World War, but have taken until now to act. In 2012, an official report warned that the building and its occupants were at immediate risk. “If the Palace were not a listed building of the highest heritage value,” it read, “its owners would probably be advised to demolish and rebuild.” In 2016, after four years of inaction, another report warned of a “substantial and growing risk [of a] single, catastrophic event.” Despite the danger, lawmakers didn’t vote to vacate the building until 2018. Even then, officials dragged their feet, with Brexit eating up parliamentary time and former Prime Minister Theresa May’s minority government keen to avoid controversial legislation.

It took a fire nearly destroying the 850-year-old Notre Dame cathedral in Paris in April to instil a sense of urgency. For Parisians, that blaze was so devastating because Notre Dame has played such a central role in French literature, history and religion for nearly a thousand years. In the British capital, there is no equivalent place of worship; the Houses of Parliament are the closest any building comes to encasing in stone the history and identity of the nation. On May 9, three weeks after the last embers in Paris were extinguished, U.K. lawmakers voted to set up an independent body to totally evacuate and refurbish Parliament. “Events like the terrible fire at Notre Dame bring home to us sharply the importance of preserving our historic buildings,” said Leadsom as she introduced the bill in Parliament. Like many other lawmakers, she had initially been skeptical of the need to evacuate this hallowed building. Her mind was changed, in part, by what she saw that day in the basement.

Venerable and vulnerable

Occupying more than a million square feet on the north bank of the River Thames, the Palace of Westminster has been the seat of the British government since 1016, though the majority of today’s Palace dates to the Victorian era. Designed in the neo-gothic style, its floor plan is as regimented as the rules observed within. It has more than 1,100 rooms, including both chambers of Parliament, lawmakers’ offices, committee rooms, libraries and pubs. It is the home of archives and art chronicling the last millennium of British history. In one form or another it has survived political crises, terrorist attacks and two major fires. But take a trip through its humid, cramped basement, and its decrepit state is obvious.

Wearing a hard hat and a hi-viz vest, Piper ducks underneath a Victorian steam pipe as he leads the way through the subterranean maze. Beside him, a large chunk of plaster has crumbled off the wall, revealing dusty brickwork beneath. Piper knows the intimacies of the exhausted building better than anyone, and remembers the acute shock he felt when Notre Dame caught fire in April. “You immediately think, God, that could have so easily been this building,” he tells TIME. “The amount of loss that could happen in the space of a few minutes…” He trails off.

A view of one of the many ventilation shafts inside the Palace of Westminster in London, packed full of cabling. Ben Quinton for TIME

Occasionally, a fire does break out. A couple of years ago, Piper was walking down this deserted passage when he smelled burning. It turned out an old electrical system had overheated behind a panel. He raised the alarm, narrowly averting a disaster. Another time, in 2016, a malfunctioning light set fire to a section of the roof. Contractors working on scaffolding nearby spotted it with moments to spare. “That was a real close call for us,” Piper says. He fears that next time, London won’t be so lucky.

If you go back far enough, London can remember what it feels like to see the foundations of its democracy burned away. On the evening of Oct. 16, 1834, a catastrophic fire struck the old Parliament building, which dated back to the eleventh century. Crowds watched in horror as the flames reflected off the River Thames, making it look as if the whole city was ablaze. Wooden beams first creaked, then collapsed. Almost all of the complex was destroyed. Many onlookers would later suffer symptoms similar to what today we would call post-traumatic stress disorder, says Caroline Shenton, the author of The Day Parliament Burned Down, a history of the 1834 blaze. “People think of these huge buildings as integral to their psychological landscape,” she says. “To see them become so vulnerable so quickly is intensely shocking.”

The Palace of Westminster was soon rebuilt, bigger and grander than before. But the seeds of today’s problems were sowed during construction, when David Boswell-Reid, a 19th century pioneer of air-conditioning, was brought in to alter the original designs. He added in dozens of empty voids, stretching vertically in shafts from the basement to the roof, and horizontally, between each ceiling and floor. The plan was for them to channel hot or cold air into each room, but the primitive system never really functioned properly. To make matters worse, after the Second World War, workers realized these invisible spaces would be ideal to conceal new pipework and wiring. Over the years, records of exactly what each pipe and wire did were lost. New utilities were laid over defunct ones, and during the 1950s were sprayed with carcinogenic asbestos when it was in vogue as a fire suppressant.

If left unchecked, it’s through these congested spaces that experts now fear a fire could spread rapidly. It’s not much of a stretch: in June 2018, the Glasgow School of Art in Scotland, which had been designed with similar ventilation shafts to those in Parliament, burned down. Nobody was killed, but the shafts wafted the blaze through the school in a matter of minutes. Much of the task of renovating Parliament, officials say, will be stripping and compartmentalizing these voids to stop them channelling fire through the building at speed.

The House of Lords photographed in session at the Palace of Westminster on January 12, 2016. Ben Quinton

One great irony of the push to restore the Palace of Westminster is that, for the duration of the work, the danger of fire will only be heightened. It’s not hard to imagine a spark from an angle grinder of temporary electrical work setting the building alight. Indeed, both the Glasgow and Notre Dame fires began while being restored. (Investigations into the causes of both fires are ongoing.) “We are very conscious that the risk of fire will, for some period, increase,” Piper says. To mitigate that risk, a fire-safety team will have to approve all restoration work being done, and workers must take the least risky path at all times. “We will take huge measures to avoid what happened at Notre Dame,” Piper says. But that might not be so easy. “Taking shortcuts is part of human nature,” says Liz Peace, the chair of the board tasked with overseeing the project.

Brits don’t need to imagine the devastation if something goes wrong. In June 2017, a fire spread with sickening speed through Grenfell Tower, a 24-story public housing block in west London, engulfing nearly the entire building in flames in the middle of the night. Flammable “cladding,” newly added to the outside of the building, acted as a chimney for the flames. Modifications to the inside of the building, like holes cut through walls to accommodate gas pipes, allowed smoke and fire to spread from apartment to apartment. Residents trapped at the top of Grenfell Tower filmed their final moments on their phones as people on the ground watched helplessly. Seventy-two people perished.

Grenfell was partly the result of authorities neglecting the housing needs of poorer, mostly ethnic minority residents. But it was also a failure of design, and Mark Tami, a lawmaker who sits on the board tasked with organizing Parliament’s restoration, is worried there could be a similar tragedy in Parliament. “There are people who work at the very top of the main chamber.” He pauses and sighs. “For some of them, there’s not an easy route out of the building.”

The stench of decay

The risks facing Parliament, where some 8,000 people work each day, aren’t limited to fire. Last year, a large chunk of a stone angel fell from Victoria Tower, the tallest part of the Palace. It sped through the air and impacted the ground with the sound of a gunshot right at the entrance to the House of Lords. “If that had landed on somebody it would have killed them instantly,” Piper says.

In the aftermath, workers went around parts of the Palace with buckets, prodding at suspect stonework and removing small pieces of loose masonry. “When they started cleaning the structure, a lot of it just fell away because the dirt and the grime was actually holding everything together,” says Tami. “When they took that off, everything just went pfff,” he says, drawing a cloud of dust in the air with his hands. Now, much of the building is covered in netting to catch chunks of falling stone. The worst walls are completely obscured by scaffolding, some of which is there not for renovation work, but purely to protect lives. “I’ve been here six years, but in the last 18 months I’ve felt the difference,” Piper says. “The extreme potential for the building to kill people is becoming more obvious.”

Blocks of masonry missing (bottom left), and blackened brickwork in the Palace of Westminster, London, on May 30, 2019. Ben Quinton for TIME

Traveling deeper into the basement, we smell the sewage room before we see it. Piper takes the lead down a dank flight of stairs, deeper into the stifling basement, to where the ejectors are located. These are giant cauldrons into which the Palace’s toilets eventually drain, where the waste of British lawmakers from William Gladstone to Boris Johnson has sat waiting to be expelled, by pressurized steam, into the London sewage system. “The basement is more likely to flood at the moment from rain than anything else,” Piper says in an attempt at reassurance. But, he says, he has discovered the room “pretty deep” in sewage more than once before.

When the sewage system fails, lawmakers can tell. Pipes occasionally burst, sending lawmakers and aides fleeing their offices holding their nostrils. On one occasion in 2016, the unfortunate occupants of one room all had to get hepatitis shots after a pipe exploded, bringing the ceiling down in a rain of excrement. That was in a different building on the Parliamentary estate, but the problems in the Palace proper are even worse. “The biggest problem at the moment is the smell,” says Tami. In the summer, the ground floor corridors of the Palace are pungent. “Everybody who works here has experienced it,” Tami says. “Unless you spend your entire time on the top floor, you’d be hard pressed to avoid it.”

Back in the basement, I stand up straight, immediately conscious of the brown flecks on the white-tiled wall I had been leaning on. Piper is unfazed. These ejectors will be stripped out in the refurbishment along with the rest of the basement, he says, slapping one of the rough iron spheres, which responds with a hollow thrum. “There’s 130 years of history in these,” he adds with a smile. “It tells some sort of story. I’m just not sure what.”

‘If we leave here, we’re never coming back’

With risks so serious, some experts say the efforts to restore the buildings are still happening too slowly. The so-called “Mother of Parliaments” in London is known around the world as a paragon of representative democracy, but it also has a reputation for glacial inertia. An opportunity to fully fix the Palace after it suffered damage from German bombs in the Second World War was missed, and since then, lawmakers and governments have largely ignored the problem.

The condition of the Palace was deliberated upon by select committees and advisory groups, in interim reports and private members’ bills. In each passing year the language got more hysterical but little changed. “If someone had to design a building to burn down,” said Tami at a debate in 2018, “this would be a pretty good one to start with.” But for a long time, some lawmakers resisted efforts to “decant” the building. “There was this idea that if we leave here, we’re never coming back,” Tami tells TIME. “I think that was particularly true for the members of the House of Lords,” he says of the upper chamber of the U.K. Parliament, where the average age is 70.

A view from the roof of the Palace of Westminster showing damage to the roof (left) and scaffolding erected for repair work (right). Ben Quinton for TIME

Even with plans now actually in place to vacate the Palace, progress is still slow. “The process is still not moving fast enough,” says Shenton, the historian. On the current timeline, lawmakers and their staff won’t even move out until 2025 at the earliest, when their alternative offices across the road are finally finished. The total cost is expected to be around $5 billion. That’s assuming local authorities don’t block or delay the plans. “It is quite a challenging deadline,” admits Peace, the chair of the restoration board. When lawmakers do eventually go, she says, the restoration work is expected to take another six to eight years, meaning the home of British democracy stands to be out of action until well into the 2030s.

And with Britain on track to leave the E.U. on Oct. 31, with or without a deal, it appears ever more likely that the coming upheaval at the seat of British democracy could coincide with a political crisis. Boris Johnson, the new Prime Minister, has said he will pull the U.K. out of the E.U. without a deal on Oct. 31 if necessary – even though a majority of lawmakers in Parliament have explicitly rejected such a “no deal” Brexit. What comes next is uncharted territory; Johnson has not ruled out locking the doors to Parliament to force “no deal” through, and his opponents have said that if that happens, they could convene in an alternative location. That has prompted some observers to compare the situation to the English Civil War in the 17th century. “Right now is not the ideal time,” Tami admits of the need to evacuate Parliament amid the biggest constitutional challenge Britain has faced in living memory.

There’s also a chance that any new Prime Minister could undo the plans to refurbish the building, consigning lawmakers to remain in the Palace of Westminster as it falls apart around them. Shenton is pessimistic. “Politicians’ attitudes today are as they were in the early 19th century,” she says, casting her gaze back to the years before the 1834 blaze. “I don’t believe that history repeats itself. But human nature does.”

Correction, Aug. 27

The original version of this story misstated the number of people who died as a result of the Grenfell Tower fire. The death toll was 72, not 71.

Write to Billy Perrigo at billy.perrigo@time.com.