A sign with the Canadian Security Intelligence Service (CSIS) logo is pictured outside the agency's headquarters in Ottawa, Ontario, Canada January 17, 2017. REUTERS/Chris Wattie

OTTAWA (Reuters) - Canada’s spy agency has settled a lawsuit by five employees who accused their bosses of homophobia, racism and Islamophobia and it will work to stamp out harassment, the head of the agency said on Thursday.

The employees filed a C$35 million ($27.4 million) lawsuit in July against the Canadian Security Intelligence Service (CSIS), saying they had been bullied for more than a decade.

CSIS Director David Vigneault said in a statement that the settlement was “in the best interest of all those concerned” but gave no details.

“CSIS does not tolerate harassment, discrimination, or bullying under any circumstances ... we will be working to ensure that the behavior of all employees reflects the CSIS employee code of conduct principles of respect,” he added.

CSIS, which employs 3,300 people, has suffered a number of problems since it was created in 1984. Last November, a court declared it had illegally kept data collected during investigations and threatened sanctions.