Sweden's Armed Forces posted this picture on Facebook in support of Stockholm Pride Forsvarsmakten

Sweden's Armed Forces have joined the celebrations of this week's Stockholm Pride with a Facebook post vowing to defend LGBT rights, showing rainbow-coloured laces on a pair of military boots.

The picture was accompanied by a message that read: "We are prepared to go as far as necessary. Your right to live how you wish, as you want and with who you want is our duty to defend.

"And we are prepared to give everything to do that."

The pro-LGBT message lies in stark contrast to the US, where Commander-in-Chief President Donald Trump recently announced a ban on transgender people serving in the country's military, citing "tremendous medical costs".

It meant Sweden is now one of only 18 countries in the world believed to allow transgender people to serve in the military.

Nemo Stjernström, spokesperson for the Swedish Armed Forces, explained the thinking behind the Facebook picture, which was posted to mark the start of Stockholm Pride on Monday (31 July).

"In part we wanted to show that we clearly take a stand for everyone's equal worth and rights," he told The Local.

"In part, that we actively, every day, contribute to ensuring we can continue to live as we wish in a free Sweden.

"Using the pride flag's colours and slipping it in to a detail on the uniform is something we have tried before and received a really good response to – it makes it very clear what we mean and what we stand for."

The post – which has generated both positive and negative reaction – has been liked by more than 5,000 people and shared around 600 times.

It comes after Sweden's left-leaning government introduced a military draft for both men and women earlier this year because of what its defense minister called a "deteriorating security environment" in Europe and around Sweden.

Sweden abolished compulsory military service for men in 2010 because there were enough volunteers to meet its military needs. It has never had a military draft for women.

The government said "the all-volunteer recruitment hasn't provided the Armed Forces with enough trained personnel. The re-activating of conscription is needed for military readiness."