In an extract from his memoir, the US whistleblower shares his experiences on the day the twin towers fell – and the aftermath that led him to join up

Whenever I try to understand how the past two decades happened, I return to that September – to that ground-zero day and its immediate aftermath. To return means coming up against a truth darker than the lies that tied the Taliban to al-Qaeda and conjured up Saddam Hussein’s illusory stockpile of WMDs. It means, ultimately, confronting the fact that the carnage and abuses that marked my young adulthood were born not only in the executive branch and the intelligence agencies, but also in the hearts and minds of all Americans, myself included.

I started working as a web designer for a woman I met in community college class. She, or I guess her business, hired me under the table at the then lavish rate of $30 an hour in cash. The trick was how many hours I would actually get paid for.

Of course, Mae could have paid me in smiles – because I was smitten, just totally in love with her. And though I didn’t do a particularly good job of concealing that, I’m not sure that Mae minded, because I never missed a deadline or even the slightest opportunity to do a favour for her. Also, I was a quick learner. In a company of two, you have got to be able to do everything. Although I could, and did, conduct my business anywhere – that, after all, is the point of working online – she preferred that I come into the office, by which I mean her house, a two-storey townhouse that she shared with her husband, a neat and clever man whom I’ll call Norm.

Yes, Mae was married. What’s more, the townhouse that she and Norm lived in was located on base at the south-western edge of Fort Meade, Maryland, where Norm worked as a linguist assigned to the National Security Agency (NSA). I can’t tell you if it’s legal to run a business out of your home if your home is federal property on a military installation – Fort Meade is the location of the NSA, the Central Security Service, US cyber command and the Defense Information Systems Agency, among other things – but as a teenager infatuated with a married woman who was also my boss, I wasn’t exactly going to be a stickler for propriety.

It’s nearly inconceivable now, but at the time Fort Meade was almost entirely accessible to anyone. It wasn’t all bollards and barricades and checkpoints trapped in barbed wire. I could just drive on to the army base housing the world’s most secretive intelligence agency in my ’92 Civic, windows down, radio up, without having to stop at a gate and show ID. It seemed like every other weekend or so a quarter of my Japanese class would congregate in Mae’s little house behind NSA headquarters to watch anime and create comics. That’s just the way it was, in those bygone days when “It’s a free country, isn’t it?” was a phrase you heard in every schoolyard and sitcom.

On workdays, I would show up at Mae’s in the morning, pulling into her cul-de-sac after Norm left for the NSA, and I would stay through the day, until just before he returned. On the occasions that Norm and I happened to overlap during the two years or so I spent working for his wife, he was, all things considered, kind and generous to me. At first, I assumed that he was oblivious to my infatuation, or had such a low opinion of my chances as a seducer that he didn’t mind leaving me alone with his wife. But one day, when we happened to pass each other – him going, me coming – he politely mentioned that he kept a gun on the nightstand.

With payments looming on my tuition loan, I had a more practical reason to spend time with Mae: money. I asked her to give me more hours. She agreed, and asked me to start coming in at 9am. It was an egregiously early hour, especially for a freelancer, which was why I was running late one Tuesday morning.

I was speeding down Route 32 under a mild, beautiful, Microsoft-blue sky, trying not to get caught by any speed traps. With a little luck, I would roll into Mae’s sometime before 9.30, and – with my window down and my hand riding the wind – it felt like a lucky day. I had talk radio cranked and was waiting for the news to switch to the traffic.

Just as I was about to take the Canine Road shortcut into Fort Meade, an update broke through about a plane crash in New York City.

Mae came to the door and I followed her up the stairs to the cramped office next to her bedroom. There wasn’t much to it: just our two desks side by side, a drawing table for her art and a cage for her squirrels. Although I was slightly distracted by the news, we had work to do. I forced myself to focus on the task at hand. I was just opening the project’s files in a simple text editor – we wrote the code for websites by hand – when the phone rang.

Mae picked up. “What? Really?”

Because we were sitting so close together, I could hear her husband’s voice. And he was yelling.

Mae’s expression turned to alarm, and she loaded a news site on her computer. The only TV was downstairs. I was reading the site’s report about a plane hitting one of the twin towers of the World Trade Center, when Mae said: “OK. Wow. OK,” and hung up.

She turned to me. “A second plane just hit the other tower.”

Until that moment, I had thought it had been an accident.

Mae said: “Norm thinks they’re going to close the base.”

“Like, the gates?” I said. “Seriously?” The scale of what had happened had yet to hit me. I was thinking about my commute.

“Norm said you should go home. He doesn’t want you to get stuck.”

I sighed, and saved the work I had barely started. Just when I got up to leave, the phone rang again, and this time the conversation was even shorter. “You’re not going to believe this.”

Pandemonium, chaos: our most ancient forms of terror. They both refer to a collapse of order and the panic that rushes in to fill the void. For as long as I live, I’ll remember retracing my way up Canine Road after the Pentagon was attacked. Madness poured out of the agency’s black glass towers, a tide of yelling, ringing cell phones and cars revving up in the parking lots and fighting their way on to the street. At the moment of the worst terrorist attack in US history, the staff of the NSA – the major signals-intelligence agency of the US intelligence community – was abandoning its work by the thousands, and I was swept up in the flood.

The NSA director, Michael Hayden, issued the order to evacuate before most of the country even knew what had happened. Subsequently, the NSA and the CIA – which also evacuated all but a skeleton crew from its headquarters – would explain their behaviour by citing a concern that one of the agencies might potentially, possibly, perhaps be the target of the fourth and last hijacked airplane, United Airlines flight 93, rather than, say, the White House or Capitol.

I sure as hell wasn’t thinking about the next likeliest targets as I crawled through the gridlock, with everyone trying to get their cars out of the same parking lot simultaneously. I wasn’t thinking about anything at all.

I remember escaping the panicked crush of the spies fleeing Fort Meade just as the north tower came down. Once on the highway, I tried to steer with one hand while pressing buttons with the other, calling family indiscriminately and never getting through. Finally, I managed to get in touch with my mother, who was working as a clerk for the federal courts in Baltimore. They, at least, weren’t evacuating.

Her voice scared me, and suddenly the only thing in the world that mattered to me was to reassure her.

“It’s OK. I’m headed off base,” I said. “Nobody’s in New York, right?”

“I don’t – I don’t know. I can’t get in touch with Gran.”

“Is Pop in Washington?”

“He could be in the Pentagon for all I know.”

The breath went out of me. By 2001, my maternal grandfather had retired from the coastguard and was now a senior official in the FBI, serving as one of the heads of its aviation section. This meant that he spent plenty of time in plenty of federal buildings throughout DC and its environs.

Before I could summon any words of comfort, my mother spoke again. “There’s someone on the other line. It might be Gran. I’ve got to go.”

She didn’t call me back. I tried her number endlessly, but couldn’t get through, so I went home to wait, sitting in front of the blaring TV while I kept reloading news sites. The new cable modem we had was proving more resilient than all of the telecom satellites and cell towers, which were failing across the country.

Facebook Twitter Pinterest ‘Pandemonium, chaos: our most ancient forms of terror. They both refer to a collapse of order and the panic that rushes in to fill the void.’ Photograph: Hubert Michael Boesl/EPA

My mother’s drive back from Baltimore was a slog through crisis traffic. She arrived in tears, but we were among the lucky ones. Pop was safe.

The next time we saw Gran and Pop, there was a lot of talk – about Christmas plans, about New Year’s plans – but the Pentagon and the towers were never mentioned.

My father, by contrast, recounted his 9/11 to me. He was at the coastguard headquarters in Washington DC when the towers were hit, and he and three of his fellow officers left their offices in the operations directorate to find a conference room with a screen so they could watch the news coverage. A young officer rushed past them down the hall and said: “They just bombed the Pentagon.” Met with expressions of disbelief, the young officer repeated: “I’m serious – they just bombed the Pentagon.” My father hustled over to a wall-length window that gave him a view across the Potomac river of about two-fifths of the Pentagon and swirling clouds of thick black smoke.

The more that my father related this memory, the more intrigued I became by the line: “They just bombed the Pentagon.” Every time he said it, I recall thinking: “They?” Who were “they”?

The US immediately divided the world into “us” and “them”. Everyone was either with “us” or against “us”, as President Bush so memorably remarked while the rubble was still smouldering. People in my neighborhood put up new US flags, as if to show which side they had chosen. They hoarded red, white and blue Dixie cups and stuffed them through every chain-link fence on every overpass of every highway between my mother’s home and my father’s, to spell out phrases such as “United we stand” and “Stand together, never forget”.

I used to go to a shooting range. Alongside the old targets, the bull’s-eyes and silhouettes, there were now effigies of men in Arab headdress. Guns that had languished for years behind the dusty glass of display cases were now marked “Sold”. Americans lined up to buy mobile phones, hoping for advance warning of the next attack, or at least the ability to say goodbye from a hijacked flight.

Nearly 100,000 spies returned to work at the agencies with the knowledge that they had failed at their one and only job, which was protecting the US. Think of the guilt they were feeling. They had the same anger as everybody else, but they also felt the guilt. An assessment of their mistakes could wait. What mattered most at that moment was that they redeem themselves. Meanwhile, their bosses got busy campaigning for extraordinary budgets and extraordinary powers, leveraging the threat of terror to expand their capabilities and mandates beyond the imagination not just of the public, but those who stamped the approvals.

The day after September 11 was the first day of a new era, which the US faced with a unified resolve, strengthened by a revived sense of patriotism and the goodwill and sympathy of the world. In retrospect, my country could have done so much with this opportunity. It could have treated terror not as the theological phenomenon it purported to be, but as the crime it was. It could have used this rare moment of solidarity to reinforce democratic values and cultivate resilience in the now-connected global public.

Instead, it went to war.

The greatest regret of my life is my reflexive, unquestioning support for that decision. I was outraged, yes, but that was only the beginning of a process in which my heart completely defeated my rational judgment. I accepted all the claims retailed by the media as facts, and I repeated them as if I were being paid for it. I wanted to be a liberator; I wanted to free the oppressed. I embraced the truth constructed for the good of the state, which in my passion I confused with the good of the country. It was as if whatever individual politics I had developed had crashed – the anti-institutional hacker ethos instilled in me online and the apolitical patriotism I had inherited from my parents were wiped from my system – and I had been rebooted as a willing vehicle of vengeance. The sharpest part of the humiliation comes from acknowledging how easy this transformation was, and how readily I welcomed it.

I wanted, I think, to be part of something. Prior to 9/11, I had been ambivalent about serving because it had seemed pointless, or just boring. Everyone I knew who had served had done so in the post–cold war world order, between the fall of the Berlin wall and the attacks of 2001. In that span, which coincided with my youth, the US lacked for enemies. The country I grew up in was the sole global superpower, and everything seemed – at least to me, or to people like me – prosperous and settled. There were no new frontiers to conquer or great civic problems to solve, except online. The attacks of 9/11 changed all that. Now, finally, there was a fight.

My options dismayed me, however. I thought I could best serve my country behind a terminal, but a normal IT job seemed too comfortable and safe for this new world of asymmetrical conflict. I hoped I could do something like in the movies or on TV – those hacker-v-hacker scenes with walls of virus-warning “blinkenlights”, tracking enemies and thwarting their schemes. Unfortunately for me, the primary agencies that did that – the NSA, the CIA – had had their hiring requirements written a half century earlier and often rigidly required a traditional college degree, meaning that although the tech industry considered my community college credits and Microsoft Certified Solutions Expert certification acceptable, the government wouldn’t.

The more I read around online, however, the more I realised that the post-9/11 world was a world of exceptions. The agencies were growing so much and so quickly, especially on the technical side, that they would sometimes waive the degree requirement for military veterans. It was then that I decided to join up.

You might be thinking that my decision made sense, or was inevitable, given my family’s record of service. But it didn’t and it wasn’t. By enlisting, I was as much rebelling against that well-established legacy as I was conforming to it – because after talking to recruiters from every branch, I decided to join the army, whose leadership some in my coastguard family had always considered the crazy uncles of the US military.

When I told my mother, she cried for days. I knew better than to tell my father, who had already made it very clear during hypothetical discussions that I would be wasting my technical talents there. I was 20 years old; I knew what I was doing.

The day I left, I wrote my father a letter – handwritten, not typed – that explained my decision, and slipped it under the front door of his apartment. It closed with a statement that still makes me wince. “I’m sorry, Dad,” I wrote, “but this is vital for my personal growth.”

Permanent Record by Edward Snowden is published on Tuesday by Macmillan (£20). To buy for £13.99 go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99.