The Duke of Cambridge has said it would be “absolutely fine by me” if in the future his children came out as gay or lesbian but he voiced concerns as to how society would react.

When quizzed about his views on his children admitting their sexuality, the duke confessed a number of parents had asked him the same question and he and wife Kate had been talking about the issue.

William’s candid admission came when he visited the London headquarters of the Albert Kennedy Trust (akt), an LGBT charity dedicated to helping young people made homeless because of their sexual orientation.

Tim Sigsworth, the akt’s chief executive, said William’s comments would make a “massive difference” and would send “a message that we need to support, and we need to empower LGBT people”.

The duke also expressed his shock at the recent bus attack on a lesbian couple saying: “I was really appalled by that attack.”

During a discussion with a group of people being supported by the charity one young gay man, who asked not to identified, said to William: “If your child one day in the future said ‘oh I’m gay, oh I’m lesbian’ whatever, how would you react?”

The duke, who was making what is thought to be the first visit by a member of the royal family to a dedicated LGBT organisation, replied: “Do you know what, I’ve been giving that some thought recently because a couple of other parents said that to me as well.

“I think, you really don’t start thinking about that until you are a parent, and I think – obviously absolutely fine by me.”

He went on to say: “The one thing I’d be worried about is how they, particularly the roles my children fill, is how that is going to be interpreted and seen.

“So Catherine and I were doing a lot of talking about it to make sure they were prepared.

“I think communication is so important with everything, in order to help understand it you’ve got to talk a lot about stuff and make sure how to support each other and how to go through the process.”

Duke of Cambridge visit to Albert Kennedy Trust
William reacts to receiving a gift bag (Jonathan Brady/PA)

Answering the hypothetical question about his children’s sexuality, he added: “It worries me not because of them being gay, it worries me as to how everyone else will react and perceive it and then the pressure is then on them.”

In a lighter moment William joked about being the July 2016 cover star of gay magazine Attitude saying luckily he did not have to appear in his underwear.

Speaking to the charity’s young ambassadors he said: “I did my Attitiude magazine cover which was a good day.

Duke of Cambridge visit to Albert Kennedy Trust
William listens to former and current service users (Jonathan Brady/PA)

“But I’d seen some of the previous front covers and I was a bit nervous about what they might ask me to do,” he laughed.

“Thankfully there were no small briefs for me!”

Mr Sigsworth, who is gay, said about William’s admission: “I was incredibly impressed.

“I was first impressed by his level of knowledge already, but his empathy and appreciation of the struggles and challenges faced by LGBT people was incredible to me.

“And just his willingness to learn from the young people, his willingness to challenge his own perceptions and his willingness to come out in support of LGBT people in such a personal way as to refer to his children, that will make a massive difference.

“I was personally rejected by my mum, and the idea that the future monarch is saying they would support their children if they came out as LGBT is a message to the whole of society really, a message that we need to support and we need to empower LGBT people.”

Later, William was asked again about his children potentially coming out by Faz Bukhari, 28, from east London, who became an ambassador for the homeless charity after being helped by the organisation when he left home aged 24 when he began to identify as transgender.

William gave a similar reply as before, saying: “I’ve only started thinking about it since becoming a parent, and it is something I’m nervous about, not of the fact if any of them were to be gay, but because of the pressures they’ll face, because of my family and the position we’re in.

“I’d fully support whatever decisions they make. It worries me how many barriers, persecution and hate they’d face. But that’s for all of us to try and correct.”

After the chat, Mr Bukhari said: “I thought his answer was so good, to hear him talk about having fears about what people might think of his children and how they might take to them, if they were identified as LGBT.

Duke of Cambridge visit to Albert Kennedy Trust
The Duke of Cambridge unveils a plaque to officially open the Albert Kennedy Trust’s new headquarters in London (Jonathan Brady/PA)

“That he recognises that, and is aware there could be a backlash, he understands the issues and hopefully with his comments we can get more awareness across to more parents of the issues.”

During his visit, William spoke of how “stifling” many young people find the burden of coming out to their families and also of his concerns about young LGBT people taking their own lives.

“It’s a real pressure to live under,” he said during a conversation with Cath Hall, akt’s founder.

“I’ve been looking into issues around suicide and I imagine that the figures in the LGBT community are high, because of all the barriers and stigma around acceptance.”

William was visiting akt’s new headquarters in Hoxton, east London, to open the building ahead of the annual Pride in London parade next weekend and to mark the 50th anniversary of the Stonewall uprising.

The charity was founded in Manchester and this year celebrates 30 years of helping young people from the LGBT community and now has additional centres in Bristol and Newcastle, providing services, support, advice and access to accommodation.