Image copyright Attitude/Leigh Keily/PA

Prince William has become the first Royal Family member to be photographed for the cover of a gay magazine.

The Duke of Cambridge spoke to Attitude about the issue of homophobic bullying, saying: "No-one should be bullied for their sexuality or any other reason."

The duke invited the magazine to bring members of the LGBT community to Kensington Palace to discuss bullying and its mental health repercussions.

Kensington Palace said William had been "moved" by the stories he heard.

The nine people who attended the meeting last month spoke of low self-esteem, suicide attempts, drug addiction and depression.

William said that "no-one should have to put up with the kind of hate that these young people have endured in their lives".

Media playback is unsupported on your device Media caption Prince William held a meeting with Attitude magazine and members of the LGBT community in Kensington Palace

The duke told the magazine: "The young gay, lesbian and transgender individuals I met through Attitude are truly brave to speak out and to give hope to people who are going through terrible bullying right now.

"Their sense of strength and optimism should give us all encouragement to stand up to bullying wherever we see it.

"What I would say to any young person reading this who's being bullied for their sexuality: don't put up with it - speak to a trusted adult, a friend, a teacher, Childline, Diana Award or some other service and get the help you need.

"You should be proud of the person you are and you have nothing to be ashamed of."

Analysis: An 'evolving monarchy'

Image copyright AP

By BBC royal correspondent Peter Hunt

The photograph of a smiling prince on the cover of a gay magazine is a sign of William's willingness to embrace the diverse nature of British society. It's also a reminder that the monarchy is an institution that can evolve.

In the late 1980s, Diana, Princess of Wales would visit people who had Aids or leprosy. Her former bodyguard, Ken Wharfe, told the Diana inquest that the Queen had asked why the princess didn't get involved "with something more pleasant".

Three decades on, her son is highlighting the work being done against bullying and in support of removing the stigma surrounding mental health.

Another striking aspect of this interview is that William is a future king. As things stand, one day he'll be head of state of the UK and 15 other countries - some of which discriminate against gay people.

Read more from Peter here

Attitude editor Matthew Todd said: "During my time as editor of Attitude I have met parents whose child has taken or lost their life after being bullied for being LGBT+ or even just perceived to be LGBT.

"I am very happy that the future king of the United Kingdom agrees this must stop and I would urge parents in particular to raise their voices in their communities to ensure that every school protects - really protects - all children."

Image copyright Attitude/Leigh Keily/PA Image caption The duke with (clockwise from far left) Matthew Todd, Paris Lees, Matt May, Charles Donovan, Melissa Whitehouse, Damilola Adejonwo, Junior Joye and Helen Walsh

A 2015 report showed that a third of young lesbian, gay or bisexual people and 48% of transgender young people had made at least one suicide attempt, compared with 18% of young straight people, Attitude said.

'Positivity and courage'

A Kensington Palace spokesman said: "The Duke of Cambridge is working hard to support the fight against bullying and to help break the stigma around mental health. He has established a taskforce on the prevention of cyberbullying and along with the Duchess of Cambridge and Prince Harry is leading the Heads Together campaign on mental health and well-being.

"He knows that LGBT young people suffer unacceptably high rates of bullying and he was grateful to Attitude for facilitating such a serious conversation on this topic. He was moved by the stories he heard and impressed by the positivity and courage of the people he met."

The cover shot was taken by Australian-born photographer Leigh Keily and shows William laughing as he rests his chin on his hand.

The issue of Attitude magazine featuring the duke went to press last week, before the shooting at a gay club in Orlando that claimed 49 lives and left dozens of others injured.

William, accompanied by the Duchess of Cambridge, visited the US Embassy on Tuesday and signed a book of condolence for the victims, later meeting representatives from the US embassy's LGBT network.