American artist Gilbert Baker, who created the rainbow flag representing LGBT rights, has died aged 65, according to his friend and rights activist Cleve Jones.

Baker came up with the iconic eight-coloured banner for San Francisco's 1978 gay freedom day, a precursor to the Pride festival, having taught himself to sew in his 20s.

The former US soldier was heavily involved in the San Francisco LGBT rights movement and was a close friend of murdered activist and politician Harvey Milk.

"I am heartbroken. My dearest friend in the world is gone. Gilbert gave the world the Rainbow Flag; he gave me 40 years of love and friendship," Mr Jones posted on Facebook.

"I can't stop crying. I love you forever Gilbert Baker."


San Francisco friends, meet me under Gilbert's flag tonight 7pm Castro/Market. pic.twitter.com/yPCk4jrXBX — Cleve Jones (@CleveJones1) March 31, 2017

The San Francisco Chronicle said the artist had died in his sleep at his home in New York late on Thursday.

His death has prompted an outpouring of tributes on social media.

"Rainbows weep. Our world is far less colourful without you, my love," tweeted filmmaker Dustin Lance Black, who won an Oscar for the screenplay to the 2008 biopic Milk, starring Sean Penn as the gay politician.

Robert York, a senior director at healthcare lobby group the National Quality Forum, wrote: "I just talked to Gilbert last month. He gave us his best and the rainbow flag will be an even more treasured keepsake of our history."

Mr Jones tweeted a photo of Baker with former president Barack Obama inviting mourners to gather for an evening vigil under a rainbow flag in the city's Castro district.