On a cold January evening, as plainclothes police officers hammered relentlessly on the door of their flat near Moscow, newlywed gay couple Pavel Stotsko and Yevgeny Voitsekhovsky began to consider fleeing Russia.

“It was a siege situation. The police were in the entrance to the building, and all around it,” Stotsko said this week from the Netherlands, where the couple, who are both 28, were recently granted asylum. “We sat in the flat like in a prison cell, totally alone and in fear,” said Voitsekhovsky.

The two men’s problems with the Russian authorities began at the start of the year after they wed in Denmark, where same-sex marriages have been legal since 2012.

Although homosexuality is not against the law in Russia, same-sex marriage is. But after studying Russian civil law, Stotsko and Voitsekhovsky realised that the authorities are obliged to recognise marriages that have been registered abroad, even those between same-sex couples. Russian officials, it appears, were unaware of the legal loophole.

Upon their return to Russia in January, the couple submitted their internal passports to a register’s office in Moscow, where a clerk “calmly and without any questions” put marriage stamps on the documents. All Russians over 14 must by law possess internal passports that document their place of residence and marital status. They cannot be used for foreign travel.

“We were so happy when we got the stamps in our passports. We thought that we could now live happily and calmly in Russia, and that, despite all the homophobia, the law was on our side,” Stotsko said. “We didn’t expect that the authorities would respond so aggressively.”

Russian MP Vitaly Milonov was very vocal about the couple’s marriage, demanding they be ‘kicked out of the country’. Photograph: Anton Novoderezhkin/TASS

Stotsko then posted online photos of the stamps in the passports and the couple gave interviews to Russian media, moves that sparked widespread outrage. Vitaly Milonov, an ultra-conservative MP with the ruling United Russia party, said the marriage stamps had no legal basis and likened Stotsko and Voitsekhovsky to “stinking goats”. He also said they should be “checked for dangerous diseases” and “kicked out of the country” as a warning to others. The interior ministry accused the men of defacing their passports, which they denied. The couple also received numerous death threats.

Human rights groups say homophobic attacks have rocketed in Russia since President Vladimir Putin approved a controversial law barring so-called “gay propaganda” in 2013, effectively making it an offence to promote LGBT rights in public. Dozens of gay men were detained and tortured in Chechnya, a mainly Muslim republic in southern Russia, last year.

Police officers soon turned up at the couple’s flat in Lyubertsy, a small town just outside the Russian capital, and demanded that they hand over their internal passports. The officers’ actions, the men say, were overseen by Andrei Zakharov, the then deputy chief of Moscow’s police. Shortly after their arrival, police cut off the internet and electricity supply to the flat, plunging it into darkness.

“For Russians, a marriage stamp in their passport is a symbol that their marriage is recognised by the state. Naturally, when the authorities realised there was no legal grounds not to recognise our marriage, they decided to get rid of any evidence that this had happened in Russia,” said Stotsko.

Yet even after the men surrendered their passports, police refused to guarantee the couple’s personal safety, Stotsko said: “Zakharov also said he couldn’t give us any assurances that he wouldn’t arrest us later.”

Terrified, the couple decided to leave Russia that very same night, assisted by members of the country’s beleaguered LGBT community. “We left in the middle of a freezing January night with just $53 between the two of us,” said Stotsko. The couple fled to Amsterdam, where they applied for asylum. They say their lawyers advised them not to speak about their ordeal until this month, when they received confirmation that they were under the protection of the Dutch authorities.

They are now hoping to eventually receive Dutch citizenship and have no plans to return home. They are pessimistic about the long-term chances of an improvement in attitudes toward LGBT people in Russia.

President Putin remains unmoved under international pressure to improve LGBT rights. Photograph: Sputnik/Reuters

“After Putin came to power, after the ascent to power of those people who came from the criminal underworld, criminal customs and ideas that ‘gays are dirty people’ gained more popularity and are now widely accepted throughout the government,” Stotsko said.

Although Russian police generally adopted a tolerant approach to foreign LGBT fans at this summer’s World Cup, which Russia hosted, homophobic attitudes are widespread.

Even in Moscow, which Stotsko says is safer than the rest of Russia, LGBT people can be subject to horrendous abuse in public, if they are open about their sexuality.

In a social experiment carried out in the city in 2015, two young men who walked hand-in-hand along the street were taunted repeatedly and even physically attacked by passersby. Last year, assailants beat a 29-year-old man to death in Moscow’s Gorky Park, near the Kremlin, “for not dressing right”.

In an eye-opening opinion poll published last month by a state organisation, two-thirds of Russians said they believed there was a worldwide gay conspiracy to subvert their country’s “traditional values”.

“Putin always says that everyone lives in Russia according to the law,” said Stotsko. “But what happened to us proves that he is a liar. We tried to live in Russian within the framework of Russian law, but instead the authorities broke the law themselves to seize our passports.”