It’s hard to be optimistic about the state of LGBT rights around the globe at the end of 2016. Despite a few pockets of progress, we are witnessing a major turn against LGBT people in several corners of the world.

First, the good news. Three tiny countries decriminalized homosexuality in 2016: Nauru, Seychelles, and Belize. The latter’s Supreme Court decision also required the country to enforce discrimination protections for gay people, and it may form a precedent to sweep anti-gay laws from the 10 Caribbean states that still maintain them on the books.

Colombia’s Supreme Court ruled in favour of same-sex marriage — although not without consequences. Marriage laws also passed in several minor territories like the Faroe Islands, Guernsey, Isle of Man, and Gibraltar, as well as in several Mexican states, and civil unions were approved in Italy and Aruba.

Voters in The Gambia just threw out a dictator with one of the worst LGBT rights records in Africa, although at the moment it looks like he may not go quietly.

But despite these small victories, an unprecedented global backlash against LGBT people started to take shape in 2016 — particularly in democratic and otherwise progressive countries.

Shortly after Mexican President Enrique Peña Nieto announced plans for a constitutional amendment allowing same-sex marriage, voters dealt his party a crushing defeat in local elections, effectively halting the state-by-state legislative progress on same-sex marriage throughout the country.

A hastily called referendum in Bermuda revealed two-to-one majorities opposed both equal marriage and civil unions. Gender equality referendums in The Bahamas and Grenada both failed, in part over fears that they would lead to same-sex marriage.

A peace deal to end Colombia’s 40-year civil war almost fell apart when voters rejected it in a referendum, in part over language recognizing the court’s marriage decision and affirming LGBT rights.

The Brexit referendum took the UK out of the European Union, significantly hobbling one of the most vocal champions of LGBT rights in the world. This month’s failed constitutional referendum in Italy also led to the resignation of a resolutely pro-LGBT prime minister, and more uncertainty for the country and the EU.

Voters in Australia and Northern Ireland returned governments opposed to LGBT rights, including marriage equality, to power (albeit narrowly).

Just this month, Chad criminalized homosexuality for the first time in its history.

And next year, right-wing populists who oppose LGBT rights look set to make gains in elections in France, The Netherlands, Germany, and possibly Italy, while constitutional bans on same-sex marriage are set to be put to voters in Romania and Georgia and may be passed in Macedonia.

And, of course, there was Donald Trump.

While any analysis of what happened in the US this year has to note that Hillary Clinton won the popular vote by a wide margin after releasing the most pro-LGBT platform of any serious presidential candidate in history, it will be the Republicans who control the White House, as well as Congress, starting Jan 20.

Trump can erase much of President Obama’s legacy on LGBT rights with the stroke of a pen. Congress will have incredible power to claw back LGBT rights over the next few years. And Trump is set to make at least one, and possibly more, Supreme Court appointment.

Globally, we can also expect a halt on American support for LGBT rights abroad. While some leaders bristled at Obama’s international activism, it can’t be denied that his and Clinton’s advocacy helped move the needle on LGBT issues profoundly. Will a lack of pressure from the US, and possibly also from a weakened EU, slow the drive for decriminalization?

Looking forward to 2017, there are few bright spots left for progress.

Taiwan may soon become the first Asian country to pass an equal marriage law. Chile, Jersey and the Falkland Islands are also set to pass equal marriage. Courts in Bermuda, Venezuela, Costa Rica, Panama, El Salvador, Romania and Northern Ireland are considering equal marriage cases, and voters in Switzerland will likely face a referendum to legalize same-sex marriage, after twice rejecting bans this year. A political settlement on same-sex marriage may also come in Australia.

Civil union bills have been introduced and stand a good chance of passing in Peru, San Marino, and Monaco next year. And if upcoming reunification talks between Cyprus and the breakaway Turkish North Cyprus bear fruit, then Cyprus’ civil union law and EU human rights will apply to the whole island.

And the UN has managed to appoint an expert on sexual orientation and gender identity, who will investigate abuses of LGBT peoples’ rights and advocate for change.

But the lesson of 2016 for LGBT activists has to be that our rights remain fragile and under threat, even in supposed liberal bastions. We cannot rest on our successes, especially when they don’t enjoy broad support from electorates. The imperative to win over hearts and minds has never been more urgent.

Against this rather bleak backdrop, Canada emerges as a rare island of progress on LGBT rights. By mid-2017, Trudeau may be the only resolutely pro-LGBT world leader with the political capital and moral authority to advocate persuasively for LGBT rights abroad.

Whether he can rise to the challenge, and how effective Canada can be at shaping global opinion remains to be seen.