Britain’s National Crime Agency has lost a high court attempt to force the daughter and grandson of a former president of Kazakhstan to explain where they got the money to buy £80m of property in London.

Last year, the NCA froze three of the family’s properties, including a mansion on north London’s so-called Billionaire’s Row with an underground swimming pool and cinema, over claims they were acquired using proceeds from unlawful activity.

The agency used unexplained wealth orders (UWOs), a power introduced in 2018 known as “McMafia” laws after the BBC’s organised crime drama and book that inspired it, to freeze the assets until the owner explains the source of their wealth. This case is only the second time such an order has been used in Britain.

On Wednesday, a high court judge granted an application to discharge the unexplained wealth orders.

The NCA said it would appeal against the decision.

One of the properties, a mansion in Hampstead, is occupied by Nurali Aliyev, the grandson of former Kazakh president Nursultan Nazarbayev, and his wife and children.

The two other properties frozen are an apartment in Chelsea, south-west London, which the campaign group Transparency International says is worth £31m, and a house in Highgate, north London.

The NCA has barred any attempt to sell the properties and argues that the wealth used to buy them was linked to Rakhat Aliyev – Nurali Aliyev’s father and the former president’s son-in-law – who was found hanged in an Austrian jail in 2015 after being charged with the murder of two bankers in 2007.

“UWOs are new legislation and we always expected there would be significant legal challenge over their use,” said Graeme Biggar, the NCA’s director general of the National Economic Crime Centre.

“We disagree with this decision to discharge the UWOs and will be filing an appeal. We have been very clear that we will use all the legislation at our disposal to pursue suspected illicit finance and we will continue to do so.”

The ultimate beneficial owners of the three properties — Rakhat Aliyev’s ex-wife, Dariga Nazarbayeva, the chair of the senate in Kazakhstan and daughter of the former Kazakh president Nursultan Nazarbayev, and her son, Nurali Aliyev — applied to the high court to discharge the UWOs.

Giving judgment remotely on Wednesday, Mrs Justice Lang overturned all three UWOs, ruling that “the NCA’s assumption” that Rakhat Aliyev was the source of the funds to purchase the three properties was unreliable.

The judge said there was “cogent evidence” that Nazarbayeva and Nurali Aliyev had founded the companies that owned the properties and provided the funds to purchase them.

“The court’s powerful judgment demonstrates the NCA obtained the orders on an inaccurate basis as part of a flawed investigation which was entirely without merit,” said Nurali Aliyev.

Britain’s first UWOs were issued against assets belonging to Jahangir Hajiyev, who was in prison in Azerbaijan for embezzlement from the state bank, and his wife, Zamira, who spent £16.3m in the London department store Harrods. She lost her appeal against the order this year.