SNP ministers are set to reverse one of Theresa May's key legacies by imposing a legal duty on public bodies to test their policies against their impact on reducing inequality.

The new Prime Minister, shortly after she became Home Secretary, branded legislation passed by Labour in the dying days of Gordon Brown's government "ridiculous" and refused to implement it, saying it would be scrapped "for good".

However, it is to be resurrected by the Scottish Government, with the administration confirming a commitment to reintroduce the so-called socio-economic duty north of the border during the current Holyrood term.

The law, part of the Equality Act, sets out a legal duty on key public bodies, including government and local authorities, to ensure they consider the impact that their strategic decisions will have on narrowing class inequalities.

Read more: Sturgeon to examine options for Scotland to remain in the UK and the EU

Ms May has attacked the proposal, championed by former Labour deputy leader Harriet Harman, as "ridiculous as it was simplistic", saying it was better to pursue "equality of opportunity" rather than "equality of outcome".

In a 2010 speech, the then Home Secretary, who succeeded David Cameron last week, said: "I do not believe in a world where everybody gets the same out of life, regardless of what they put in. That is why no government should try to ensure equal outcomes for everyone."

Read more: Sturgeon to examine options for Scotland to remain in the UK and the EU

Nicola Sturgeon's poverty advisor, Naomi Eisenstadt, had called on the First Minister to use new powers for Holyrood to bring in the measure in Scotland, leading to the SNP committing to the move in its Holyrood manifesto.

A Scottish Government spokesman confirmed: "Following powers being devolved to us through the Scotland Act we have made a commitment to introduce the socio-economic duty this parliamentary term."

The SNP said Ms May's approach to the law raised questions over her commitment to improving the lives of the most disadvantaged.

A party spokesman said: "The fact that the new Prime Minister called a policy aimed at reducing inequality ‘ridiculous’ shows exactly where her priorities lie – and raises questions about how serious she is in her comments of recent days about tackling inequality.

Read more: Sturgeon to examine options for Scotland to remain in the UK and the EU

"The SNP Government continues to implement laws, such as the socio-economic duty which Ms May blocked in 2010, in order to tackle the scourge of inequality. Whilst Theresa May has been claiming her commitment to social justice in recent days, her past statements and voting record on these issues show a very different picture."