The last time I saw Xulhaz Mannan, who has been murdered for defending gay rights in Bangladesh, was at a dinner in May 2014. It was a balmy evening, and he and all his co-editors at Roopbaan, the country’s first and only LGBT magazine, were among those gathered at a Dhaka restaurant.

The conversation soon turned to Roopbaan’s upcoming second issue. They were still buzzing from the launch: the inaugural issue had sold out in a few days. Orders had come in from as far away as New Zealand and the United States.

Bangladesh, like neighbouring India, criminalises homosexuality, with fines and imprisonment. Xulhaz announced that Roopbaan’s printers had received warnings against printing the magazine but assured us that keeping a low profile would ensure the magazine’s survival. Adamant that Roopbaan’s goal was to be a literary venture within a largely marginalised community, he was refusing all interview requests from international media. We didn’t know then that the printers would cancel their contract with Roopbaan within a week, after receiving death threats if collaborations continued.

“Roopbaan was discussed in a government cabinet meeting and the magazine was placed in front of the prime minister six days ago,” one of Xulhaz’s colleagues wrote to me a few weeks later. “She was obviously not happy to see it. Then three days ago the local newspapers stated that the government intelligence is looking for us. Xulhaz wants to stay and fight. He’s willing to go to jail if necessary.”

Bangladesh’s growing conservatism prevented Roopbaan from ever printing a second issue, and its visionaries spent the next two years in constant fear. Extremists had already begun to murder bloggers and academics for expressing secular thinking, based on a list of 84 intellectuals that terrorists had published in 2013.

That evening in the restaurant, Xulhaz was his usual generous and positive self, despite these looming threats. As always, he refused to let anyone else pick up the tab for the meal. As always, he ensured I had a ride home before he went back to his own house.

Two years later, it was there that he was hacked to death by half a dozen machete-wielding men. This was one of the few times in the wave of murders, which began with blogger Ahmed Rajib Haider’s killing in February 2013, that a public intellectual had been killed in their own home.

I keep imagining Xulhaz’s last moments before his killers arrived, pretending to be working for a courier company. In the presence of his mother, they chopped down Xulhaz and Tonoy Majumder, his friend and fellow LGBT activist, before fleeing the scene.

Were Xulhaz and Tonoy in the dining room drinking his famous masala chai, I wonder? Or in the main living room, where Xulhaz entertained 150 people in the summer of 2013? Back then, Xulhaz had yet to join the American development agency USAid, and worked as a protocol specialist for the US embassy in Dhaka. The guests that night included US ambassador Dan Mozena, whose security detail lined the block around Xulhaz’s apartment.

For those of us who came to know Xulhaz’s house as a centre of storytelling, theatre, dance and poetry, the two recent murders are an attack on what it means to be a Bangladeshi.

With Bangladesh’s gay community thrown into chaos, several leading activists have gone underground. One of Roopbaan’s editors, speaking on the condition of anonymity, said: “Xulhaz was the head of our community.” Between sobs, he added: “He knew that despite our differences, we all believed in the same cause of furthering gay rights. But what happens when your leader is cut down? Your courage is irrevocably thwarted. We were all cut down today. It’s likely we will be unable to do this kind of work again.”

Another of Xulhaz’s colleagues, who has received dozens of death threats in the last year, blamed himself for fostering Xulhaz’s enthusiasm about Roopbaan. “I killed him,” he said. “Xulhaz would be still alive if we were not so eager to engage with the community.”

Aware of Xulhaz’s connections in the diplomatic world, his friends believed these guaranteed his safety. That such a stalwart promoter of human rights could be hacked to death was beyond our comprehension.

Roopbaan was not Xulhaz’s only attempt to normalise homosexuality in Bangladesh, where it is still technically illegal under Article 377 of the constitution. Two years ago, he also organised a Rainbow Rally for the Bengali new year celebrations in Dhaka. The colourful protest was a silent one, with men marching in alignment with the annual April parade, creating a rainbow flag with their clothing. This year, police ordered him not to repeat the exercise. To add insult to injury, four of Xulhaz’s gay friends were arrested for protesting against this order. They were released only after their parents were informed that their sons were gay. Close friends believe Xulhaz was followed home when he went to the police station to demand their release, and this is how the extremists found him.

We knew the situation was heating up. What we didn’t know was how low the zealots would stoop.

The international community has been shocked by the murders of Xulhaz and Tonoy, with US secretary of state John Kerry voicing his “outrage”. Sixteen public intellectuals have now been murdered since 2013, with four killings in the past month alone. Free speech is under attack, and Bangladesh’s government seems unable or unwilling to defend it. Denying the involvement of foreign Islamist terrorists and blaming homegrown terrorism instead – even though al-Qaida’s South Asia chapter has claimed responsibility for the attacks – the government seems to feel no urgency about defending citizens who are brave enough to air secular views.

Xulhaz wasn’t just a friend. He was an inspiration to thousands, in both the diplomatic and local communities. Bangladesh has lost one of its strongest LGBT advocates and, indeed, one of its most patriotic citizens.

Two years ago, I pleaded with Xulhaz to leave Bangladesh in the face of growing fanaticism. “I don’t want to be a martyr,” he told me. “Nor do I want anyone else to be … but I don’t want to be an escapist … Keep us in your prayers.”

Xulhaz and Tonoy believed in the right to love freely, without condemnation. They did not believe in dying for the cause, but they did believe in being responsible citizens with the duty to educate others against homophobia.

It’s time the Bangladeshi government and opposition parties rose above their petty politics to address the real matter. Almost half a century ago, Bangladesh fought for its liberation from Pakistan after intellectuals were murdered. Now a second war against critical thought is in full swing, yet the government is failing to take on the attackers. It needs to act. Bangladesh cannot afford to lose its brightest minds to zealots like these, because this signals the death of the very democracy it fought to establish.