Media playback is unsupported on your device Media caption The balloon travelled 21.1 miles (34.1km) into space

The rainbow flag that symbolises gay pride has been sent into space for the first time via a high-altitude balloon.

Planting Peace, a US-based non-profit group that seeks to "spread peace in a hurting world", launched the flag near Milwaukee, Wisconsin, on 17 August.

The balloon captured video with a GoPro camera as it floated 21.1 miles (34.1km) above earth for three hours.

Organisers said they wanted to declare space gay friendly, "in a peaceful, beautiful way".

Image copyright YouTube/PlantingPeace Image caption The balloon gave the flag just over three hours in space before it returned to earth

Image copyright YouTube/PlantingPeace Image caption The non-profit group wants gay people to feel safe in every corner of the universe

The balloon and its flag returned to earth, but the episode was captured in striking footage that shows the planet's surface from above, with the sun beaming behind the flag.

The non-profit group said: "The primary purpose of this declaration is to support the ongoing fight for the fundamental human rights of our LGBTQ [Lesbian, Gay, Bisexual, Trans and Queer] family, moving us closer to a universal understanding that all people deserve to live freely and love freely without fear and discrimination."

It added that the stunt emphasised the need for the gay community to have a safe space in every corner of the universe.

As well as gay rights activism, Planting Peace runs humanitarian aid projects and environmental initiatives across the world.

It recently made headlines during the Republican National Convention in Cleveland, Ohio, with a billboard that showed US presidential candidate Donald Trump and then-aspiring Republican nominee Ted Cruz poised to kiss, with the slogan "Love trumps Hate. End homophobia".

Image copyright Reuters Image caption The group paid for a billboard in Ohio showing Donald Trump and Ted Cruz in a clinch in July

Read more:

"I'm gay - but I wasn't 'born this way'"

Modern Family features transgender child actor

The transgender Republican trying to change her party