Kendall said the therapy he underwent at the insistence of his parents while a teenager drove him to the brink of suicide and did nothing to turn him into a heterosexual.

A lawyer for the ban’s sponsors objected to Kendall being allowed to testify, saying it’s irrelevant to the legal issues in the case.

The Republican mayor of San Diego says he used to be against gay marriage but flipped on the issue.

In other testimony, San Diego Mayor Jerry Sanders recalled the “defining moment” of his personal and political life when he decided that denying gays and lesbians the right to wed was discriminatory. The change of heart came about in part after he learned his daughter was a lesbian in a committed relationship.

“I had been prejudiced,” Sanders said. “I was saying one group of people did not deserve the same respect, did not deserve the same symbolism of marriage and I was saying their marriages were less important than those of heterosexuals.”