Canada’s spy service has settled a C$35m lawsuit launched by five employees who alleged they suffered years of bullying in a workplace rife with racism, homophobia and anti-Muslim sentiment.

The allegations against the Canadian Security Intelligence Service, documented in a statement of claim filed in July in Federal Court, offered a view into one of the country’s most secretive organisations.

Based on the experiences of five veteran employees, court documents painted a picture of a hostile work environment where “racist, sexist, homophobic and discriminatory behaviour has become the accepted culture and norm”. None of the allegations were proved in court.

On Thursday CSIS director David Vigneault said in a statement that a settlement had been negotiated, describing it as “in the best interest of those concerned”. He gave no details on the terms of the settlement, calling it a confidential matter.

“CSIS does not tolerate harassment, discrimination, or bullying under any circumstances,” he said. “The complexity of the ever-evolving threat environment requires that all CSIS employees are equipped to give their best. As such, I strongly believe in leading an organization where each employee promotes a workplace which is free from harassment and conducive to the equitable treatment of all individuals.”

In the statement of claim, the five employees allege that some members of management mocked, abused and threatened employees, setting a tone that permeated through the 3,300-person workforce. When confronted, the managers in question allegedly refused to acknowledge the behaviour as wrongful conduct.

One employee, who is gay and has a Muslim partner, alleged that since he had arrived at the Toronto office 10 years ago, some managers routinely highlighted his sexuality in day to day communication, using terms such as “gay boy”, “fag”, “fag boy” and “homo”.

Several of the plaintiffs described a workplace where anti-Islamic comments and views were commonplace, while one intelligence officer alleged she was made to feel by management as though she was a “token black woman (who) was promoted without merit”.

All five employees said they had taken extended leave from the agency and, in several cases, were struggling with stress, anxiety and depression that they linked to their treatment at the agency.

The agency was the latest Canadian security force to be rocked by accusations of inappropriate behaviour. Last year the Royal Canadian Mounted Police formally apologised and earmarked C$100m for payouts to hundreds of current and former female officers who were subjected to sexual harassment and discrimination, while a 2015 investigation into the Canadian armed forces uncovered widespread sexual misconduct and hostility towards minorities and women.