TORONTO -- The principal and headmaster of a private Toronto French school apologized Wednesday to two former students who alleged they were defamed for being Muslims.

The apology, delivered in court through their lawyer, was part of a settlement in three lawsuits filed by Omar Elgammal and Danial Velshi, which were being tried together.

"My clients acknowledge in hindsight some matters could have been handled better and if the plaintiffs' feelings were hurt, they are sorry," David Tompkins told the court.

The settlement also calls for the Toronto French School to send a letter to parents, staff and alumni saying the pair have been accepted in the school community.

"TFS has accepted the regret expressed by Danial and Omar for what occurred and we too regret what occurred that gave rise to the court case," the letter reads.

The remaining terms of the settlement are not being disclosed.

Elgammal and Velshi -- both now 20 -- said they were relieved the six-year ordeal is over.

"It's proof that they were wrong, that they did something wrong," Velshi said after the hearing. "It's been dealt with."

"It was a rollercoaster but I think we're glad we're off now," Elgammal added. "Hopefully this doesn't happen to anybody else ever again."

The two alleged they were publicly blamed by administrators for a fight with a student from another school.

Elgammal and Velshi claimed the fight broke out on Oct. 28, 2008, over racial slurs the other teen used to describe them and their relatives. They were 14 at the time.

They alleged school officials -- including headmaster John Godfrey, a former Liberal MP, and principal Heidi Gollert -- denounced the pair at a school assembly and in emails to parents and alumni.

Elgammal and Velshi were suspended from school and charged with assault, but the charges have since been withdrawn.