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 have been 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."
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.
"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."