Dr Benjamin Carson, a neurosurgeon with Johns Hopkins University and a conservative speaker, has apologised for comments made on Fox News comparing gay people to a pedophilia advocacy group, as well as to bestiality.

In March Dr Carson appeared on Fox News, and told the show’s host, Sean Hannity: “My thoughts are that marriage is between a man and a woman. It’s a well-established, fundamental pillar of society and no group, be they gays, be they NAMBLA (North American Man/Boy Love Association), be they people who believe in bestiality–it doesn’t matter what they are–they don’t get to change the definition.”

The remark sparked outrage due to the apparent comparison of same-sex marriage to pedophilia and bestiality.

Students at Johns Hopkins University, where Dr Carson was scheduled to give a commencement address, arranged a petition for him to be pulled from the role.

On Friday Mr Carson wrote a letter to the University apologising for the negative attention his comments had brought and expressing sadness at the pain caused by “poorly chosen words”.

He wrote: “As you know, I have been in the national news quite a bit recently and my 36 year association with Johns Hopkins has unfortunately dragged our institution into the spotlight as well. I am sorry for any embarrassment this has caused.

“But what really saddens me is that my poorly chosen words caused pain for some members of our community and for that I offer a most sincere and heartfelt apology. Hurting others is diametrically opposed to who I am and what I believe. There are many lessons to be learned when venturing into the political world and this is one I will not forget.

“Although I do believe marriage is between a man and a woman, there are much less offensive ways to make that point. I hope all will look at a lifetime of service over some poorly chosen words.”

The same day Dr Paul Rothman, the University Medical School’s dean, said Dr Carson had the right to express his opinion, but added: “We recognize that tension now exists in our community because hurtful, offensive language was used.”

Mr Carson became popular in conservative political circles after he spoke out against Obamacare at the National Prayer Breakfast, a high-profile event attended by President Obama.