A French ambassador has resigned, accusing the country's foreign ministry of abject racism. Zaïr Kédadouche, France's man in Andorra is now suing over the discrimination he claims is endemic in the country's elite diplomatic service.

In a letter to the country's president, François Hollande, Kédadouche wrote: "I am resigning in the name of the values of the Republic that the Quai d'Orsay has flouted … It's at the ministry of foreign affairs that I have met the most abject racism and felt the humiliation of not belonging to the same social class."

He accused the ministry of imposing a "terrible omertà", or code of silence, on diplomats and insisted his was not the only case of discrimination.

"My case is not unique, far from it. If that was the case, it would only be personal," he wrote.

Kédadouche worked in several French ministries before Hollande's centre right predecessor Nicolas Sarkozy appointed him ambassador in 2012. The former professional footballer was born in France's northern industrial region to a refuse collector father and an illiterate mother, both from Algeria. He grew up on a housing estate in one of Paris's roughest suburbs and was a rarity in a ministry staffed mainly with graduates of France's elite higher education institutions known as the grandes écoles.

"The children of immigrants, African, Maghrebains … who have not 'done' the grandes écoles but are former sportsmen and women of a high level, or artists or have acquired skills by the result of their own hard work, have the right, as do all citizens, to become ambassadors of a France that respects all her children," he wrote.

"Certain heads at the Quai d'Orsay considered my origins and my name as a handicap, when it could have been a considerable advantage."

Kédadouche's resignation came hours after strident criticism of the justice minister, Christine Taubira, for reportedly failing to sing the French national anthem at a ceremony to mark the end of slavery. Members of the Socialist government described the attacks as a form of "ambient racism".

Taubira, from French Guyana, has been subject to a series of racial slurs in public, in print and on the internet.

On Tuesday, Kédadouche told France Info radio: "There were posts I was refused because I had an Algerian name … this is unacceptable.

"People at Quai d'Orsay don't accept diversity. They pass jobs among themselves, among families that have gained a certain noblesse. There are still Bastilles to storm and the Quai d'Orsay is a bastille to demolish."

Kédadouche said both Hollande and the foreign minister, Laurent Fabius, had tried to persuade him to stay.

"My bosses were well aware of the difficulties … posts were proposed … but on reflection I decided to refuse," he said.

"I wanted the administration to say 'we have badly behaved, our agents have badly behaved against our values' and for those people to be sanctioned, not for them to give me a job and tell me to shut up."

The foreign ministry said Kédadouche's accusations were "without foundation or the slightest proof".