Geoffrey Cox has been shifted out of government today after being told by the prime minister to step down as attorney general. He is being replaced by former Brexit minister Suella Braverman, whose appointment was announced this afternoon.

Cox, who became Whitehall's most senior law chief in July 2018, posted his resignation letter on Twitter. He said: 'I am writing to resign that office, as you requested, as a result of the reshuffle and associated changes you wish to make.'

Describing Brexit as the 'great political mission of our time', Cox said: 'Throughout that process, I have sought, as my role requires, to give candid and independent legal advice both to you and to your predecessor on how that desirable outcome might best be achieved lawfully and effectively.'

As attorney general, Cox was 'honoured to lead and work with distinguished and impressive lawyers and civil servants' in the Attorney General's Office and Government Legal Department.

He said: 'Good work has been done to lay the foundations for appropriate review of the workings of the criminal justice system, to take a firm grip of the problem of disclosure, to equip the CPS with the means to perform its essential functions and, in introducing new governance frameworks, to enable more effective superintendence of both the CPS and SFO. I have also been able to propose workable solutions to the legitimate demands of our veterans for protection from repeated investigation and prosecution. I wish the government and my successor well in taking that forward.'

Cox recalls 'bluntly' telling MPs last September that 'they risked incurring the wrath of the British people by continually frustrating the result of the [EU] referendum, and that a reckoning at the polls would come'.

In a memorable appearance in the Commons chamber, Cox told MPs: 'We now have a wide number in this house setting their face against leaving at all. When this government draw the only logical inference from that position, which is that we must leave therefore without any deal at all, they still sets their face, denying the electorate the chance of having their say in how this matter should be resolved. This parliament is a dead parliament. It should no longer sit... They don’t like to hear it, Mr Speaker. They don’t like the truth. Twice they have been asked to let the electorate decide whether they should continue to sit in their seats, while they block 17.4 million people’s votes. This parliament is a disgrace.'

When grilled by MPs on the legal advice given to the Queen to prorogue parliament, Cox suggested parliamentary scrutiny of judicial appointments may be needed. Earlier this week he suggested there was a case for looking at how Supreme Court justices are appointed.

Braverman read law at Queens' College, Cambridge University. She did a masters in European and French Law at the Pantheon-Sorbonne in Paris. She sat the New York Bar exams and qualified as an attorney in New York State. She trained as a barrister in London and worked at the bar for 10 years, specialising in planning law and judicial review.  

Downing Street confirmed that Robert Buckland will remain lord chancellor and justice secretary.