David Miranda, a child of the Rio de Janeiro slums who became a leading voice for gay rights in Brazil’s Congress and who played a supporting role in the leak of classified documents by Edward J. Snowden, died on Tuesday in Rio de Janeiro. He was 37.
His husband, the American journalist Glenn Greenwald, said Mr. Miranda died in the intensive care unit of a hospital after a nine-month struggle with an abdominal infection.
It was Mr. Miranda’s role in the Snowden leak that led to his political career.
In 2013, Mr. Snowden, a former contractor with the National Security Agency, handed a trove of highly classified documents about American surveillance programs to Mr. Greenwald and several other journalists, infuriating American officials and setting off an international debate over mass surveillance and privacy.
Mr. Miranda helped lead an effort to obtain asylum in Brazil for Mr. Snowden, who had flown to Hong Kong from Hawaii and was wanted on criminal charges by the United States. The campaign attracted the support of a number of Brazilian celebrities, and the foreign relations and defense committee of the Brazilian Senate recommended granting asylum.
Ultimately the effort failed, and Mr. Snowden flew to Russia, where he was later granted citizenship.
That same year, 2013, Mr. Miranda was detained and interrogated for nine hours by the British authorities at Heathrow Airport in London as he was traveling from Berlin to Rio. He was carrying documents related to the Snowden leaks, and the government confiscated his phone, laptop, camera, memory sticks and DVDs.
An appeal in the case led to a 2016 court ruling that a key part of the law under which he had been detained, Britain’s Terrorism Act 2000, was “incompatible with the European convention on human rights.”
In a tweet on Tuesday, Mr. Snowden praised Mr. Miranda for his courage.
“I will never forget that when the U.K. broke its own laws to detain David as a ‘terrorist’ for daring to aid an act of journalism — and threatened to throw him in a dungeon for the rest of his life — he never faltered,” Mr. Snowden wrote. “Instead, he dared them to do it.”
That experience was a political awakening for Mr. Miranda and gave him the name recognition to seek a political career in Brazil. In 2016, he ran for a City Council seat in Rio, pledging to defend L.G.B.T. rights and fight inequality. He became one of the council’s first openly gay members.
Monica Benicio, a Rio councilwoman and gay rights advocate, said in an interview that Mr. Miranda had been a born leader who “became a symbol of the fight for L.G.B.T. rights in Brazil and abroad.”
In 2019, when Jean Wyllys, an openly gay member of Congress, resigned and went into self-imposed exile because of death threats, Mr. Miranda was appointed by the Socialism and Liberty Party to take his place.
He immediately became a foil for Brazil’s far-right president, Jair Bolsonaro, who was known for his incendiary comments about women and gay and Black people. Shortly after Mr. Wyllys gave up his seat, Mr. Bolsonaro tweeted, “Great day!”
“One L.G.B.T. person is leaving, but another is coming in,” Mr. Miranda replied. “See you in Brasília,” the nation’s capital.
Mr. Miranda was attacked by Mr. Bolsonaro’s allies in Congress, throwing him off balance just as he was trying to get his bearings in an institution where most lawmakers were wealthy white men.
“I was feeling like I didn’t belong,” he said in a 2019 interview with The New York Times. “Everyone else seemed like they knew what they were doing.”
His battle with the Bolsonaro administration intensified a few months later, when Mr. Greenwald’s news organization, Intercept Brasil, published reports suggesting that Mr. Bolsonaro’s main opponent in the race, former President Luiz Inácio Lula da Silva, had been improperly jailed just six months before the election, raising questions about the legitimacy of Mr. Bolsonaro’s victory.
Mr. Greenwald and Mr. Miranda said they had both faced death threats as well as “official acts of reprisal.”
He was running to be elected to the seat he held when he was hospitalized for a gastrointestinal infection in August 2022.
David Michael dos Santos Miranda was born on May 10, 1985, in Rio de Janeiro. He was the son of a prostitute, who died when he was 5, and was raised by an aunt in Jacarezinho, a favela in the city. He dropped out of school when he was 13.
He was 19 when he met Mr. Greenwald, then a 37-year-old New York lawyer, on a beach in Rio after accidentally knocking over Mr. Greenwald’s drink with a ball.
Three days later, they moved in together. Mr. Miranda soon resumed his studies and earned a degree in journalism. They adopted two children in 2018 and at third in 2021.
In addition to Mr. Greenwald, their sons João Victor, Jonathas and Marcelo survive him.
In October, Brazilian voters ousted Mr. Bolsonaro and elected Mr. Lula to replace him.
Mr. Lula praised Mr. Miranda on Tuesday as a young man with “extraordinary trajectory.”
That trajectory — a gay, Black orphan’s path from a Rio slum to the halls of Congress — Mr. Greenwald told The Times, was “all too rare in a country plagued by massive racial and economic inequality.”