The first openly gay Mayor of Houston has finished her term – after six years in the role.

Democrat Annise Parker made history in 2010 when she became the first out mayor of a major US city.

She has pursued a number of pioneering LGBT reforms during her time in office – though not always without controversy.

Last year, Mayor Parker suffered a crushing defeat when voters opted to repeal the Houston Equal Rights Ordinance (HERO) – the only law in the city outlawing anti-LGBT discrimination.

A group of Houston pastors who oppose LGBT rights banded together to fight the law, which had been championed by Mayor Parker.

The anti-HERO campaign was heavily criticised for suggesting the law lets trans people rape children in bathrooms – despite no such reported case ever – but the fear-based campaign managed to win over voters, who repealed the law by 61 percent to 39 percent.

As there is no state-wide law protecting LGBT workers in Texas, and the federal Equality Act continues to be blocked by Republicans in US Congress, the defeat effectively made it legal to discriminate against LGBT people in employment.

Ms Parker has been repeatedly targeted personally by anti-LGBT activists. At an anti-HERO rally, one of the pastors leading the campaign called for God to “free” the Mayor from her “condition”.

Pastor Dave Welch rambled: “Why would we expect someone to live lawfully when they are living lawlessly.

“The mayor who lied about everything from the beginning… she literally is one of those who is caught in the darkness of her snare and her condition.

“We do pray for her… that God delivers her and lets her free from that. But we’re going to make sure she’s not Mayor of Houston anymore!”

In fact, Ms Parker served the maximum of three two-year terms, and was prevented running again by the term limit. Democrat Sylvester Turner succeeded her.

Ms Parker said: “It’s been an honour serving my hometown for over 18 years.

“Tonight was the last time I exit City Hall as your Mayor, which has been the best job I’ve ever had.

“Goodnight, Houston!”

Ms Parker married her partner Kathy Hubbard in 2014, in California. Same-sex marriage was banned in Texas at the time.