Media playback is unsupported on your device Media caption Gilbert Baker's flag became a symbol of diversity and inclusion

Gilbert Baker, an artist based in San Francisco who created the rainbow flag as a symbol for the gay community, has died aged 65.

The San Francisco Chronicle said Baker died in his sleep at his home in New York on Thursday night.

He initially designed an eight-colour flag in 1978 for the city's gay freedom day, the precursor to the modern pride parade.

The rainbow flag has been raised in central San Francisco to honour him.

It is flying near Harvey Milk Plaza, named after America's first openly gay politician, a close friend of Baker before his assassination in 1978.

Image copyright Reuters Image caption Baker (r) with the then New York Mayor in 2002, at one of the many Gay Pride parades he attended

Baker's close friend Cleve Jones said on Twitter: "My dearest friend in the world is gone. Gilbert Baker gave the world the Rainbow Flag; he gave me forty years of love and friendship."

Screenwriter Dustin Lance Black, who wrote the screenplay for Milk, the biopic of the politician, tweeted: "Rainbows weep. Our world is far less colourful without you, my love. Gilbert Baker gave us the rainbow flag to unite us. Unite again."

California State Senator Scott Weiner said Baker's work had "helped define the modern LGBT movement".

"Rest in power, Gilbert," he said.

Image copyright Getty Images Image caption The flag became a symbol of diversity and inclusion

'A people, a tribe'

According to his website, Baker was born in Kansas in 1951 and served in the US army from 1970 to 1972, which stationed him in San Francisco in the early days of the gay liberation movement.

He was honourably discharged, taught himself to sew and began a flag-making career which would include creating designs and displays for several world leaders including the presidents of France, Venezuela and the Philippines.

Baker's original flag had eight colours, each representing a different aspect of humanity:

Pink - sexuality

Red - life

Orange - healing

Yellow- sunlight

Green - nature

Turquoise - art

Indigo - harmony

Violet - human spirit

Read more: The rise of the rainbow flag

Image copyright EPA Image caption The Brandenburg Gate, the White House, the Eiffel Tower and other landmarks were lit in rainbow colours after the attack on a gay nightclub in Orlando in 2016

Image copyright Getty Images Image caption These people used body paint to give a message of solidarity with the LGBT community after 49 people were killed in the Orlando attack

It would later be reduced to six stripes, removing pink and indigo, and swapping blue for turquoise.

Baker said he wanted to convey the idea of diversity and inclusion, using "something from nature to represent that our sexuality is a human right".

In 2015, New York's Museum of Modern Art acquired the flag for its design collection, calling it a "powerful design milestone".

"I decided that we should have a flag, that a flag fit us as a symbol, that we are a people, a tribe if you will," Baker told the Museum in an interview.

"And flags are about proclaiming power, so it's very appropriate."