The experience of death, which had bound them together a quarter of a century ago, unexpectedly reunited them on an unseasonably warm January afternoon in 2013. They made their way down East 32nd Street in Manhattan just after two o’clock, wending sedately towards the stark black doorway of the Cutting Room, a performance space hosting the memorial service for Spencer Cox, one of the country’s most recognisable Aids activists. Long before the glass doors swung open, a line stretched down the block. Taxis deposited luminaries from the worlds of science and medicine, of theatre, advertising, media, of activism, art, and academia, people from all over the United States, from Europe and Africa. Many of them were hollow-cheeked and balanced on canes or on one another, slowed by age or disease or a reluctance to re-enter the community of the grieving. Even the nimble among them wore haunted expressions. If you knew what to look for, you saw in their faces the burden of a shared past, the years and years of similar services. This was what survivors of the plague looked like.

The crowd swelled to 500. Some among them were adorned in mementos: faded protest buttons or T-shirts with militant slogans. This was the generation that fought Aids from the dawn of the global pandemic. Most had been members or supporters of the Aids Coalition to Unleash Power, or Act Up – the radical protest organisation that started in New York City but went on to count 148 chapters in 19 countries, with perhaps 10,000 members at its peak. The movement collapsed in the mid-1990s, when the advent of effective medicine finally staunched much of the dying. In the decades since then, it had seemed that the menace had receded, at least in America. But death convoked them one more time.

Few people personified the epidemic’s long history in America more than Cox. A college dropout, he was just 20 years old when he received his grim diagnosis. Given only a few months to live, he threw himself into Act Up, becoming a central player in the movement’s treatment and data committee, where patients and their advocates puzzled through the science of virology, chemistry, and immunology. Their insights won them audiences with researchers in the deepest corridors of science – audiences, then respect, then working partnerships; it was the first time patients had joined in the search for their own salvation.

Cox, a consummate networker, illustrated the developing science by submitting his own health complications to the scrutiny of reporters. In his drive to give the disease a face, he kept no aspect of his life with HIV offstage – not his rapid viral mutations, his enlarging lymph nodes, the humiliating and painful diarrhoea that regularly sidelined him, or the cruel complication that turned his left eye cloudy and useless.

Cox looked like a teenager, not able to grow a beard. But he displayed a researcher’s grasp of his own cellular tapestry

That was how I first met him. In the winter of 1988, I was reporting for the Village Voice. He brought me his latest laboratory results to help describe how certain experimental drugs were thought to work, and how, in fact, they uniformly failed. We met in a dark coffee shop late in the morning. Short and smooth faced with dark eyes and floppy black hair, he arrived Brando-style in industrial work boots, jeans tight as a sunburn, and a black leather bomber jacket over a white T-shirt – the uniform of Act Up. His youth disarmed me. He looked like a teenager, not yet able to grow a beard. But he displayed a researcher’s grasp of his own cellular tapestry and a facility for rendering complex immunological principles into everyday language. He was anything but self-pitying. Reaching into a canvas army surplus bag, he spun a sheaf of his own lab results across the table towards me, accompanied by a line from Bette Davis that was lost on me. Until shortly before then, Cox had learned much of what he knew from the movies, especially those of the 1940s and 50s, or the theatre, which had been the subject of his aborted education.

Over the ensuing years, he became a principal source for much of my Aids reporting for New York magazine, the New York Times, GQ, Newsweek, among others, and among the most effective treatment advocates in the field. But his seminal achievement came in the area of biostatistics. It was Cox who conceived the drug trial innovations that in record time helped to bring to market the therapies that stopped HIV from being an automatic death sentence. He claimed no credit for this, and until shortly before his death only a few insiders were aware that a self-taught person with Aids had made this history-changing contribution.

* * *

As movements go, the one Act Up spearheaded against HIV was unique. The virus made its traumatic appearance at different times across the globe – perhaps as early as 1920 in what is now known as the Democratic Republic of Congo. After sporadic cases through the 1970s, the viral epidemic was first reported in New York City and California. On 3 July 1981, Centers for Disease control released a report stating that symptoms now known to be typical Aids-related illnesses had been exhibited by 26 gay men. That same day, the New York Times reported 41 cases of Kaposi’s sarcoma – “a rare and often rapidly fatal form of cancer” – affecting 41 gay men in New York and California. Health authorities in the United Kingdom acknowledged the first cases there later that year, and outbreaks reached a handful of European and African nations in 1982. Today, no country has been spared, and 35 million are infected.

But throughout the plague years – when no effective treatment existed, and death was quite nearly guaranteed – New York City remained the epicentre of the disease, and America the main obstacle to research and treatment. It took two years for the city’s mayor, Ed Koch, to acknowledge its existence publicly. President Ronald Reagan waited six. But their words were hollow. Both continued to practise obfuscation, budgetary strangulation, and aggressive apathy even as the number of dead Americans passed 20,000, and 1.5 million more were believed to be infected. By the end of 1986, the city’s gay ghetto was a tinderbox. Along Christopher Street you could see the dazed look of the doomed, skeletons and their caregivers alike. There was not even a false-hope pill for doctors to prescribe. The estimates we heard were that half the gay men in New York were already infected, and for the rest of us it was simply a matter of time.

Then one morning in December, bus shelters and bank windows in a large part of Manhattan were covered with large, ominous posters, featuring a pink triangle floating against a black background. This was a potent reminder, not at all an obscure one, of how gays were marked by the Nazis in the camps. The global LGBT movement had long ago reclaimed the pink triangle to signify liberty. It was the symbol used for gay pride marches, on the covers of gay magazines, on T-shirts from gay cruises. But on the mysterious poster, the triangle had been inverted – no longer pointing downward like a yield sign, it was depicted there as a pyramid, invoking cosmic power and strength.

Beneath this image was an arresting message in blocky white letters: SILENCE=DEATH.

Three thousand of these posters went up, from the East River to the Hudson and stretching north from the Village through Chelsea to Hell’s Kitchen and the Upper West Side, and as far south as SoHo – not just in the gay ghetto but in the outposts of the arts communities where allies might find meaning in the message. For a long time, those posters, produced by an anonymous collective, were all anybody talked about. Who was behind them? What did they mean? It was obvious that the posters were addressing those of us living inside the plague. Part of the message was easily discerned: on the current course, we were surely doomed. Less clear was what these posters were asking us to do. The slogan suggested a corollary. We knew what the opposite of death was. But what kind of non-silence was being called for?

The fuse was lit, and in early 1987 Act Up was formed following a fiery town meeting at Bailey House, a residence at the far end of the West Village where Christopher Street met the Hudson River. Conceived as a place for homeless people with Aids to live out their last days, it became the city’s LGBT community centre.

Calling itself “a diverse group of individuals united in anger and committed to direct action to end the Aids crisis,” Act Up adopted a deceptively simple demand: drugs into bodies. The New York group grew to several hundred members, drawn by word of mouth, and chapters quickly proliferated, including in London. Though most were people who were new to political action, the leaders of Act Up were shrewd and relentless, attacking the government and the pharmaceutical industry in mass demonstrations. It took them little time to realise the scientific problem would require leadership: which drugs into bodies? Even six years into the plague, nobody had a theory for beating Aids.

The Aids campaigner Spencer Cox. Photograph: Walter Kurtz

Spencer Cox joined a small committee to take on the science, hoping that by arming themselves with its language, they could engage scientists in meaningful dialogue. They passed among themselves used textbooks on immunology and virology, cellular biology and medical statistics (they also read Derrida, Foucault, and Genet). And with the gathering armies of Act Up activists standing outside the doors, they marched into the halls of science as unwanted – then begrudgingly accepted, then admired – collaborators. They called this their “inside/outside” strategy.

Act Up redrew the blueprint for activism in a media-saturated world, providing inspiration for groups such as Black Lives Matter, pro-democracy activists in Moscow, and even a new generation of Americans mounting daily protests against Donald Trump.

It revolutionised everything from the way drugs are researched to the way doctors interact with patients. Ultimately it played a key role in catalysing the development of the frontline drugs that, following a major breakthrough in 1996, are now keeping 16 million people alive worldwide, returning to them the promise of a near-normal lifespan. Some had been just breaths away from their own deaths. But after a few weeks on treatment they rose from their hospital beds and, against all reasonable expectations, went home to resume an ordinary life. So dramatic was their resurrection that stupefied doctors began calling it the Lazarus effect.

And yet the pharmaceutical marvels Cox fought so hard to bring into existence failed him in the end. His infection proved to be resistant to many drug combinations. The country’s best doctors tinkered with “salvage” regimens specifically for him, accomplishing numerous barely-in-time rescues. For more than half his life Cox careened from one medical trauma to another, maintaining his trademark cheery facade, though over time he had grown weary. The last time I saw him he spoke of feeling run down. When he checked into the hospital a few weeks later, his immune system was severely compromised, putting him at risk of a host of fatal infections. Doctors diagnosed hypoglycemia and severe pneumonia. By the following Tuesday, at 44 years old but wracked and worn as an ageing guerrilla soldier, he died from complications of Aids.

So went the global Aids pandemic in its fourth decade. A precise number of deaths cannot be fixed, as the majority have occured in areas of sub-Saharan Africa seldom visited by doctors or census takers. At the time of Cox’s death, the body count was as high as 40 million – nearly twice the devastation of the bubonic plague that threatened humankind in the 14th century. In the US, the official count was 658,507 dead by the end of 2012 – an approximate figure, despite its ring of precision. In the early years especially, many people were declared dead from other causes, in order to spare the relatives from stigma, or because doctors mistook the symptoms. Some deceased went down as suicide statistics, having chosen pills or bullets or the high-rise window.

Though so much has changed, so much is still the same. Around the globe, two million people still die from Aids every year because the cost of the effective medicines – under a dollar a day – is prohibitive. In America, where the price is 50 times higher, a federal law has provided the treatment to indigent patients since 1987. This policy was adopted after intense lobbying by leaders of the gay community, but access to the drugs was still spotty, because a prescription was required and many patients could not afford the initial payment necessary to visit a doctor. The year Cox died, 13,711 other Americans died of Aids. As in 1981 – the epidemic’s very first year – most belonged to communities that were stigmatised, marginalised, feared, or hated. Cox had begun his journey through the plague as a gay man at a time when most Americans supported laws criminalising homosexuality. He finished his life entirely dependent upon social services for his day-to-day living, on probation for a criminal conviction after a descent into drug addiction.

Few of his old colleagues knew about Cox’s last days. The members of Act Up had drifted far apart. Even Cox’s old HIV-positive support group, the members of which had relied upon one another at the height of the crisis and vowed to be at one another’s side when the time came, scattered once Aids became a condition that could for the most part be managed. “When we realised we weren’t going to die,” said David Barr, who convened the support group, “we all got sick of each other.”

Act-Up protesters at the Gay and Lesbian Pride march in New York City, in 1988. Photograph: The New York Historical Society/Getty Images

That could not have been foreseen at the support group’s height. In the epic struggle for survival that consumed the plague years, these men – Barr, an attorney by training; Peter Staley, a former bond trader; Gregg Bordowitz, an experimental filmmaker; Derek Link, a former bookstore clerk; Mark Harrington, a film archivist – were among the recognised generals, the architects and administrators of the movement’s public health strategy. Successive presidential administrations sought their insights, and Nobel prize-winners adopted their critiques. Global pharmaceutical companies succumbed to their demands, at first out of fear of guerrilla protests, later out of respect for their minds. Embracing their reputations for arrogance and insolence, and their high profile, they had jokingly called themselves “the HIVIPs”. That anyone with HIV had a chance for an ordinary life was thanks to the work these men did.

Yet their extraordinary journeys had rendered them mostly unprepared for an ordinary life. In countless ways, survival proved as hard to adjust to as the plague itself. Many in the at-risk communities shared this paradox, whether or not they had been infected themselves. Nobody left those years untouched by what they had witnessed, not only the mass deaths – 100,000 lost in New York City alone – but also the foul truths that a microscopic virus had revealed about American culture: politicians who welcomed the plague as proof of God’s will, doctors who refused the victims medical care, ministers and often even parents who withheld all but the barest shudder of grief. Such betrayals would be impossible to forget.

The burden of memory was something Cox spoke about with deep insight. Sensing its toll on the mental health of survivors, he formed a new organisation to bring attention to these unanticipated problems. In our “hour of victory”, depression and isolation were growing. So was a syndrome labelled “survivor’s guilt”, an idea that bound the survivors more to the dead than to the living. Add to this the unrecognised health consequences common among those diagnosed in the 1980s – including rapid ageing issues, and an onslaught of end-of-life cancers and conditions. Cox saw all of this coming. He issued white papers and penned op-eds, but despite those efforts, he was unable to spark the interest of researchers or funders, much less of the generation of gay people who never experienced the plague. His new organisation withered, and he sank deep into his own depression and isolation.

Cox felt erased, his suffering – which had enlightened the public and challenged science – suddenly insignificant

I remained closer to him than most of his friends over his final year. In our last conversation, he bitterly complained that the community that inherited the advances he helped make, who lived integrated lives as gay Americans, who went on to fight for marriage equality and against discrimination in the military, whether or not they had been infected, had abandoned his generation and forgotten the events that had shaped them. He felt erased, his suffering – which in the past had enlightened the public and challenged science – suddenly insignificant. His new policy was to talk as little about his personal health as possible.

It wasn’t until after he died that I learned that Cox, a regular poster on the website Gawker, used the nom de plume “Shanghai Lil” to describe his agony in those final months. “Some days, I’m fine, and get around with no problem,” he wrote. “Other days, I’m curled in [the] foetal position in bed the whole day (and more often, several days), racked with pain the whole time. Some days I’m on the subway getting the stink-eye from some old or pregnant lady who clearly wants my seat, and can’t tell just by looking at me that I’m sitting because I’m on my way home from a doctor’s appointment, and if I stand for one more minute, I’m going to fall on the ground.”

When grieving friends were packing away Cox’s possessions after his death, they found a shelf of unopened medicine bottles and a drawer full of unfilled prescriptions. Apparently Cox had stopped taking his hard-won medicine, which accounted for his rapid demise. Angry speculation about this consumed his friends, but most agreed that it signalled a post-trauma syndrome unique to survivors. Many of the 500 people waiting outside the Cutting Room for Cox’s memorial service recognised that they shared the symptoms. In the tradition of the movement, people in line accorded it an irreverent name – Aids survivor syndrome, or Ass – and took it very seriously.

The doors of the Cutting Room swung open at precisely 2.30. The mood inside was mostly sombre and reflective, despite the efforts of the pair of drag queens – done up as Joan Crawford and Cox’s totem, Bette Davis – greeting mourners. A video played campy scenes from the old films that always ran through Cox’s mind and frequently spilled from his lips. The camp sensibility was lost on almost nobody except perhaps for Cox’s mother, Beverly, who had travelled up from Atlanta. She steadied herself on the arm of Nick Cox, Spencer’s only sibling, who is also gay. They took seats in the first row, alongside friends of the family. A mother’s grief was a thick wall around them.

When Larry Kramer arrived, one of the organisers took him by the arm. “Follow me, I have a seat for you,” he said, leading him through the crowd to the second row. Among the activists, Kramer alone was accorded this special treatment. No individual was more responsible for galvanising the Aids movement than Kramer. His plays, books, and op-ed pieces over the years pushed the gay community to demand that the world take notice. Now 77, he stayed as busy as ever, though Aids had slowed him noticeably and he too felt a touch of the survivor’s syndrome. That morning he had seriously considered not coming. What finally motivated him to take a cab uptown was a need to stand with his fellow survivors, for whom his emotions were boundless. “Love was always love, anytime and anyplace,” Gabriel García Márquez wrote, “but it was more solid the closer it came to death.”

Chip Duckett, a professional party planner who had organised the affair, walked to the stage to begin the service. “If there was ever any question that Spencer Cox would stop at absolutely nothing to be at the centre of attention” – he broke for over-eager laughter – “this is it.”

He passed the microphone to a succession of speakers, eventually introducing Mike Isbell, Cox’s partner for more than eight years. After their breakup, they had remained friends for many years, but as he had with so many people, Cox pushed Isbell away as his troubles grew. They had not spoken in some time. “Spencer often didn’t make it easy for people who loved him,” Isbell began. “The Aids epidemic traumatised Spencer, and I imagine this trauma stayed with him until the end. I recall being at dinner parties – some of you were probably there – or out to meals with friends, where someone would talk about ‘living with Aids’ and Spencer would immediately reply, ‘I’m not living with Aids, I’m dying of Aids!’ He’d say this in a tone of defiance, but I knew he was scared to death.”

Isbell spoke of how ironic it was that Spencer lost his way after the treatments came and the lifesaving mission came to an end. “He desperately wanted another life outside of Aids,” he said, looking around the overflowing room. “It seemed that in the ‘treatment era’, he was always in search of something but not finding it.”

The author, Aids campaigner and gay rights activist Larry Kramer, founder of Act Up. Photograph: New York Times Co./Getty Images

Peter Staley was the last to speak. He had been unable to sleep the previous few nights, struggling to find the words to make sense of Cox’s death and life. Staley was among a small group of people who had raced to Cox’s side when they had learned about the final hospitalisation. By the time he arrived, Cox was already in steep decline: he had gone into cardiac arrest three times, and his kidneys had failed. Staley stood outside the hospital door as medical personnel rushed in and out. Staley could hear the defibrillator lifting Cox’s chest off the table again and again. When Cox was stabilised, Staley and Tim Horn, another activist, were allowed inside briefly. Minutes later came another heart attack and another brutal resuscitation.

From his telephone, Staley posted a note to a private Facebook message group where he had been coordinating support for Cox. It landed in my phone with a vibration and a jingle, as I stood in the cold morning sun on Sixth Avenue, a mile and a half away: Spencer had died. I slumped, lightheaded and bereft, against a plate glass window.

The four weeks between then and the memorial service had done little to dim Staley’s pain. He placed the pages of his planned eulogy on the small lectern, squinting into the harsh stage lighting to study the faces before him.

He said: “I first met Spencer when he started showing up at Act Up meetings in the fall of 88. We were all so young. I was younger than most. But he was seven years my junior.”

He caught his breath, remembering.

“It was a wonder watching him wow the FDA, and in meetings with the biggest names in Aids research, like Anthony Fauci. He earned the respect and the love of his fellow science geeks and those of us lower down the learning curve … Eight million on standardised regimens. Eight million lives saved. It’s a stunning legacy, and so bittersweet. How could that young gay man, confronted with his own demise, respond with a level of genius that affected millions of lives but failed to save his own?”

Staley spoke of Cox’s last failed burst of activism, and called on the weathered activists to snatch meaning from his death. “He spoke out forcefully about the depression and PTSD that the surviving generation of gay men from the plague years often suffered from, regardless of HIV status. While many of us, through luck or circumstance, have landed on our feet, all of us, in some way, have unprocessed grief, or guilt, or an overwhelming sense of abandonment from a community that turned its back on us and increasingly stigmatised us, all in an attempt to pretend that Aids wasn’t a problem any more.”

He scanned the vacuum-quiet room. “That is Spencer’s call to action,” he said, “and we should take it on.”

This is an edited extract from How to Survive a Plague, published by Picador on 1 December. There will be a special screening on Thursday 1 December of David France’s film How to Survive a Plague at the Cinema Museum, London SE11, at 7pm; it will be introduced by Peter Staley.

• Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.