The last British member of the European court of justice has said she could sue the EU over an attempt by the bloc’s 27 member states to force her out.

Eleanor Sharpston, who is an advocate general to the court in Luxembourg, is set to be replaced by a Greek candidate because of Brexit.

Asked whether she might take the EU to the court of justice over her removal, Sharpston said she was considering her case.

“I have not made up my mind,” she told the Law Gazette. “It may be that the very last service I can render to my court is to see whether there is something I can do to push back against the member states intruding into the court’s autonomy and independence.”

Shortly before the UK’s withdrawal from the EU, the member states stated that the mandates of all UK-related members of the bloc’s institutions would automatically end on 31 January.

Sharpston, whose mandate will end in October 2021, has been told that she will only remain in post until her replacement has been appointed. The number of advocates general, who advise the court’s judges, remains fixed at 11.

The EU member states’ position in relation to Sharpston’s tenure is said to be legally doubtful. The court’s statute states the mandate of a serving member can only be terminated for disciplinary reasons, by the court acting unanimously. Sharpston, a fellow of King’s College, Cambridge, and a former joint head of chambers in London, has been at the ECJ since 2006.

The court’s British judge, Christopher Vajda, has already lost his seat despite the UK remaining within the single market and customs union until the end of 2020. There are 27 judges sitting on the ECJ – one for every member state.

Vajda, who would otherwise have stayed a judge on the court until 2024, told the Law Gazette it was a pity the British government could not retain representation through the so-called transition period.

“The UK had a very weak hand,” he said.