Solicitor David Gauke has been named as lord chancellor and secretary of state for justice in a surprise element of the government reshuffle. He will be the sixth incumbent in the post in six years and, as the first ever solicitor in the role, breaks a run of four consecutive non-legally qualified lord chancellors.

Gauke was previously secretary of state for work and pensions. In the 2016 EU referendum he voted remain. He was born in 1971, educated at a state comprehensive in Ipswich, and read law at St Edmund Hall, Oxford University. He qualified as a solicitor in 1997 and worked for City firm Macfarlanes until his election as MP for South West Hertfordshire on 5 May 2005.

He replaces David Lidington MP who was moved to the Cabinet Office after barely six months in post.

In a statement tweeted by the Ministry of Justice following his appointment, Gauke said: 'I am looking forward to meeting experts and front line staff to drive the crucial work started by my predecessors, to reform our prisons and courts, uphold the rule of law and promote our world-leading legal services.’

The Law Society welcomed the appointment. 'We congratulate David Gauke on being appointed lord chancellor and secretary of state for justice,' Law Society president Joe Egan said.

He inherits the role at a time of challenge for the legal sector, Egan said, adding: 'Priorities include promoting access to justice, ensuring the viability of legal aid and delivering an effective court modernisation programme.

'In addition, the lord chancellor will be a prominent voice as we seek to gain the best possible deal for the UK legal sector in the government’s negotiations for a new relationship with the European Union post-Brexit.'

Chair of the bar, Andrew Walker QC, echoed the theme: 'We look forward to working with the new lord chancellor to ensure access to justice is available to all, to ensure that the system for securing the administration of justice is resourced properly and functioning effectively, and to achieve fair and sustainable public funding arrangements for advocacy and legal advice.

'Following significant cutbacks in the provision of legal aid over several years it is vital that the Ministry of Justice completes the thorough review of the Legal Aid, Sentencing and Punishment of Offenders Act to which it is already committed, to ensure that the public interest in the provision of high quality and efficient legal services is addressed.

'The global reputation of the UK’s legal services sector, which is underpinned by the independence of our judiciary, are hugely important national assets which must be defended. That is why is it is so important that the court transformation programme is managed well and addresses the needs of all stakeholders.'

Former justice minister Dominic Raab MP is to move sideways to the high profile job of minister of state for housing at the newly rebranded Ministry of Housing, Communities and Local Government. He has been replaced by Penrith MP Rory Stewart MP, who moves from the department for international development.

Prisons and probation minister Sam Gyimah has also departed the Ministry of Justice. Gyimah will take on the role of universities and science minister, replacing Jo Johnson.

Lucy Frazer, a barrister and MP for South East Cambridgeshire, has been appointed parliamentary under secretary of state at MoJ.