Solicitors should refuse their client's instruction if it breaches their code of conduct, the Law Society has said, after the first female practising Afghan barrister in England and Wales was told by an instructing solicitor that the client wanted a white, male barrister instead.

Barrister Rehana Popal, of 10 King's Bench Walk in London, posted on Twitter yesterday that a solicitor had called her to say that a case she had previously been instructed on, which was adjourned due to a lack of judges, had been re-listed for next month.

'However, the client has said he doesn't want an Asian female but a white male barrister. Solicitors asked if I could please return the papers. Great to know that no matter what you do in life, you'll still be judged by the colour of your skin and gender,' said Popal, who specialises in human rights, public and civil law.

Popal posted her tweets hours after lord chancellor David Gauke championed the importance of diversity at a women in law conference entitled 'Levelling the playing field'.

The Law Society said today that it could not comment on an individual case. However, Christina Blacklaws, president, said: 'What we can be clear about is that solicitors must not discriminate unlawfully against anyone on the grounds of any protected characteristic. A solicitor should refuse their client’s instruction if it involves the solicitor in a breach of the law or the code of conduct. Where a solicitor realises they have breached the code they may have a duty to report themselves to the regulator.'

Today Popal tweeted that she was 'overwhelmed with the kind messages of support', saying it was 'reassuring to know that there are those in the profession who do no and would not tolerate this kind of behaviour'.

The supportive messages Popal received immediately after her tweets show her experience is not unique.

Criminal defence solicitor Jon Black said his firm refused to give in to a client's demand that the firm replaced an Asian female barrister with a white male barrister. 'We are not going to pander to racism,' he said.

The Solicitors Regulation Authority's Code of Conduct states that solicitors must not discriminate unlawfully in the course of professional dealings and must provide services 'in a way that respects diversity'.