In March 2009, Mara Keisling visited the White House. It was an event that has now become typical; Keisling estimates she’s been in the White House dozens of times since then. But back then, it was a big deal — even historic.

“As far as I know, I was the first trans person invited as a trans person to the White House,” Keisling, who’s the executive director of the National Center for Transgender Equality (NCTE), told me. She thought back to the first trans policy session she took part in at the White House, noting the tragic irony that it was held in the Indian Treaty Room — a place that symbolizes the many broken promises the US government has made to Native Americans.

Despite the setting, things panned out much better for Keisling and her group. As she put it recently, reflecting on President Barack Obama’s administration’s lasting impact on LGBTQ and particularly trans people, “We were heard for the first time.”

When Obama took office, there was really no way to know just how much progress he would make on LGBTQ issues. George W. Bush’s presidency had been awful for LGBTQ people — Bush, for one, backed a constitutional amendment to ban same-sex marriage. On the campaign trail, Obama had clearly signaled that LGBTQ people would fare better under his administration, but just how much better was unclear. Would Obama really prioritize these issues when he had an economic crisis to deal with and a health care law to pass?

But wins for LGBTQ people have come at a dizzying pace since 2009. The Supreme Court enshrined the right to same-sex marriage in the Constitution — first by ending the federal ban on same-sex marriages in 2013, then states’ bans in 2015. Congress in 2009 passed a federal hate crime law protecting LGBTQ people, and in 2010 repealed “don’t ask, don’t tell,” the military’s ban on gay soldiers serving openly.

Where courts and legislators didn’t act, Obama stepped in. He signed executive orders prohibiting federal employers and contractors from discriminating against LGBTQ people. His administration interpreted federal civil rights law to shield trans people from discrimination in the workplace, housing, and schools — which eventually put the administration in the middle of a political and legal firestorm when North Carolina in 2016 passed a law prohibiting trans people from using the bathroom that aligns with their gender identity. The administration last year eliminated military regulations that prohibited trans people from serving openly, even after the repeal of “don’t ask, don’t tell.” And that’s only a sampling of dozens of changes.

All along the way, Obama reached some crucial symbolic milestones, from becoming the first sitting president to come out for marriage equality in 2012 to being the first president to acknowledge trans people in a State of the Union speech in 2015. And he directed all the agencies under him to do the same — to take as inclusive an approach as possible toward LGBTQ folks.

“I thought we would never have to deal with the Department of the Interior on anything,” said David Stacy, government affairs director at the Human Rights Campaign (HRC), an LGBTQ rights group. “But even the Department of the Interior moved forward — with the designation of Stonewall as a national landmark.”

The depth of progress, LGBTQ advocates told me, was impressive. “I think he gets an A-plus” on LGBTQ rights, James Esseks, director of the ACLU's LGBT and HIV Project, said. “He’s done more than any prior president. Not everything’s done — far from it. But he’s helped make serious progress for LGBT people.” He added, “Just speaking for myself, I had great hopes. I had long lists, and many people had long lists of things we wanted to see. In December of 2008, after the election but before inauguration, I would not have believed you if you told me that this list of things would have happened.”

That’s not to say everything was perfect. Obama didn’t move as quickly as many LGBTQ advocates would have liked. The treatment of undocumented LGBTQ immigrants under Obama’s tenure remains a major fault on his record. The continued mistreatment of LGBTQ people in federal prisons is still far too common.

And the future is unclear. Although LGBTQ advocates don’t expect President-elect Donald Trump and his administration to undo everything that moved forward under Obama, they expect him to roll back some, even a lot, of it.

But when you put it all together, the Obama administration has molded an incredibly impressive record on LGBTQ rights — and that, advocates say, is worth celebrating.

Obama himself provided a model for change on LGBTQ issues

Although Obama himself did not end America’s federal and state bans on same-sex marriage (the Supreme Court did), his approach to the issue is something that LGBTQ advocates came back to as the example of how the administration got these issues right.

Consider the administration’s reaction to the 2015 Supreme Court ruling in favor of marriage equality, in which they lit up the White House in rainbow colors to show their support for LGBTQ rights:

This was emblematic of what LGBTQ advocates said was one of the most important things that Obama did: His rhetoric, especially compared with that of previous presidents, was unmatched in its friendliness and inclusiveness. That alone, advocates said, was crucial for the movement — by helping legitimize views that were hugely controversial in the public’s mind just a few years ago.

“The bully pulpit was something that was something just spectacular,” Keisling of NCTE said. “I know people want to look at policies and what policies are most important, but the one thing tying [all the policies] together is the recognition that we fit in.”

Yes, it is easy to look at Obama’s LGBTQ-inclusive comments as just words — especially in cases that weren’t immediately followed with policy changes. Yes, Obama was simply following public opinion on a lot of these issues. And yes, Obama could have acted and spoken up sooner.

But the way Obama was so open to embracing LGBTQ rights was still important. He gave Americans a model, advocates said, for them to change their minds on LGBTQ issues, including marriage.

Think of the evolution that most Americans genuinely went through: Most of them were, just eight years ago, opposed to marriage equality. But over time, as they gave the issue more thought, as they saw their family members and friends come out, as they saw that same-sex couples just want the opportunity to share the same kind of love that others have for opposite-sex partners, Americans came around.

Obama legitimized what he called an “evolution” on these issues. When he said in 2012, “I’ve just concluded that for me, personally, it is important for me to go ahead and affirm that I think same-sex couples should be able to get married,” that resonated, LGBTQ advocates say, with the millions of other Americans who changed their minds or were considering changing their minds on this issue. “It was really the messaging frame that a lot of people were working with,” Stacy of HRC said.

And although it’s difficult to draw a hard link to Obama, 2011 was the last time more Americans opposed marriage equality than supported it, according to Gallup’s surveys.

It wasn’t just words, either. Although Obama never could do much directly on marriage — since bans on same-sex marriage were by and large at the state level — his team did take some steps to ensure the end of these bans. In 2011, the administration said that it would no longer defend the Defense of Marriage Act, the federal ban on same-sex marriages — striking a serious blow at the constitutional legitimacy of the law. And in 2015, the administration filed an amicus brief in favor of repealing states’ bans on same-sex marriage as well, arguing that same-sex marriage was a constitutional right.

“Would we have won in court anyway? Yes, absolutely,” Rachel Tiven, CEO of Lambda Legal, told me. “But for the Justice Department to change its position and grant the Supreme Court the opportunity to see this as a mainstream position — not a radical position — I think when we look back on this, we will see that as really pivotal.”

Plus, Obama did have a little influence in the Supreme Court’s ruling: He appointed two of the five justices (Sonia Sotomayor and Elena Kagan) who would strike down the federal and state bans on same-sex marriage.

This was the model the Obama administration followed: When it spoke on LGBTQ issues, it did so in an inclusive manner. And if it could follow up with policies, it usually did.

When Congress failed, Obama stepped in for LGBTQ people

During Obama’s time in office, there were multiple pushes to pass the Employment Nondiscrimination Act (ENDA) and, later, the Equality Act. These laws would fill a big civil rights gap in the US: It’s not explicitly illegal under most states’ and federal laws to discriminate against LGBTQ people based on sexual orientation and gender identity in the workplace, housing, public accommodations, and schools.

The efforts failed to make headway in Congress, leaving LGBTQ Americans vulnerable to getting fired from a job, evicted from a home, or kicked out of a hotel or restaurant — solely because of their sexual orientation or gender identity.

While Congress failed, Obama took a number of steps to correct the situation. For one, in 2014 he signed executive orders that in total prevented the federal government and federal contractors (including big companies like Exxon Mobil) from discriminating against LGBTQ employees. Again, advocates would have preferred him to act sooner, but at least he acted.

“With a very uncooperative Congress, he was able within the executive branch to make incredible changes, both as executive orders and in rulemaking that protected LGBTQ people in a whole bunch of ways,” Rebecca Isaacs, executive director of the Equality Federation, told me.

The scope of this move, LGBTQ advocates said, was massive. “The US government is the largest employer in our country,” Janson Wu, executive director of GLAD, said. “So when the administration said that LGBTQ employees would be protected from discrimination, it was an enormous statement to all employers across the country.”

But the Obama administration didn’t stop there. Following rulings by the courts and the Equal Employment Opportunity Commission, which oversees workplace discrimination complaints, the Obama administration interpreted federal civil rights laws to protect trans people from discrimination based on gender identity in the workplace, housing, and schools. The idea: Discrimination against trans people is, fundamentally, rooted in stereotypes surrounding a person’s sex, so discrimination against trans people is sex discrimination, which is illegal under federal law.

Federal courts have consistently embraced this view, but the Obama administration’s embrace “amplified this view,” Tiven of Lambda Legal said. (The US Supreme Court may rule on this issue in the next few months through the ongoing G.G. v. Gloucester County School Board, which has pitted a trans boy against his local school district.)

One of the most remarkable moments on this particular issue didn’t directly involve Obama, but rather his attorney general. After North Carolina passed a law that banned trans people from using the bathroom that aligns with their gender identity in schools and government buildings, the Department of Education and Justice Department warned the state that the law puts it at risk for losing federal school dollars — because the law violated Title IX, which bans sex discrimination in federally funded schools.

In a moment that came to define her brief time as head of the Justice Department, Attorney General Loretta Lynch was unequivocal in her defense of the administration’s stance.

“Let me also speak directly to the transgender community itself,” Lynch said. “Some of you have lived freely for decades. And others of you are still wondering how you can possibly live the lives that you were born to lead. But no matter how isolated, no matter how afraid, and no matter how alone you may feel today, know this: that the Department of Justice and, indeed, the entire Obama administration want you to know that we see you, we stand with you, and we will do everything we can to protect you going forward. And please know that history is on your side.”

The speech came not just with a federal lawsuit but also with federal guidance that instructed public schools to allow trans students to use bathrooms and locker rooms that align with their gender identity, not the gender they were assigned at birth. (The guidance has been challenged in court by multiple states.)

This, ultimately, came to represent the Obama administration’s approach for LGBTQ people: Not just policy changes that can get lost in their technicalities, but a strong rhetorical embrace for LGBTQ people to accompany those policy changes as well.

The administration had many other LGBTQ accomplishments too

The list of the administration’s LGBTQ accomplishments really goes on.

There was the Matthew Shepard and James Byrd Jr. Hate Crimes Prevention Act, which added sexual orientation and gender identity to federal hate crimes protections in 2009. The law was in 2016 used for the first time to prosecute an anti-trans hate crime, although widespread federal prosecutions were never the measure’s intent.

“The idea was not ever that the federal government would prosecute a ton of hate crimes. That’s not how the statute works in terms of race or national origin,” Stacy of HRC said. Instead, the law provided two major benefits for victims of anti-LGBTQ hate crimes: It gave the federal government a backstop in case local police or prosecutors weren’t taking a hate crime seriously — and in doing so encouraged local jurisdictions to take the crimes more seriously, since no one wants the feds swooping into their jurisdiction. It also let the feds stay involved in local investigations, which can be far too complicated and resource-intensive for some smaller communities to handle.

There was also the 2010 repeal of “don’t ask, don’t tell,” which prohibited gay people from serving openly in the military. This was followed by the 2016 repeal of medical regulations that similarly prohibited trans people from serving openly.

“That was a policy that required discrimination against gay people,” Esseks of the ACLU said of “don’t ask, don’t tell.” “We don’t have many laws that require discrimination of any kind. We still have some. But that was a big one to get rid of.”

This is by no means a comprehensive list. There were many other LGBTQ achievements during the Obama era, including Obamacare’s anti-discrimination provisions in health care for trans people, adding LGBTQ protections in the Violence Against Women Act, letting trans people change their gender markers on passports, international outreach efforts for LGBTQ equality, a new national strategy against HIV/AIDS, and the designation of the Stonewall Inn, the site of a massive pro-LGBTQ protest in 1969, as a national monument.

In fact, it’s hard to find a federal agency that didn’t move in a progressive direction on LGBTQ issues. This was deliberate: Keisling of NCTE pointed to a memo that Obama signed early on telling federal agencies to find ways to be more inclusive toward LGBTQ people.

“We were like, ‘This isn’t very helpful,’” Keisling said at first. “It was basically telling all the agencies to look for ways to make policies more fair for LGBT people. And we were like, ‘This is just words! There’s no actions here!’”

But, she added, “I think it turned out to be maybe the most important thing the president did. He said to all the policymakers in the federal government, ‘Hey, for 200-some years we’ve been ignoring these folks and actively hurting them. Why don’t we knock that off and try to get some good policy done?’”

The result is myriad changes, from new laws and executive orders to new national monuments, that will mark the highlights of Obama’s legacy on LGBTQ issues.

Still, Obama could have done more

None of that is to say that Obama was perfect on these issues. Advocates pointed to a few areas in which the administration seriously let them down.

Take immigration. It isn’t at first glance an obvious LGBTQ issue, but advocates raised it again and again as perhaps the biggest blemish on Obama’s LGBTQ record.

As they put it, Obama has deported more immigrants than any other president in US history. In 2013, his administration hit the all-time annual record of deportations, with more than 400,000 deportations recorded. It would oversee a steep decline afterward — to 235,000 in 2015 and 240,000 in 2016. But in all, the Obama administration pushed well over 2 million deportations — and probably close to 3 million by the time Obama leaves office, if trends from past years continue.

So what does this have to do with LGBTQ people? As Immigration Equality executive director Aaron Morris explained to me, the issue is that these deportations, while bad for anyone, hit LGBTQ immigrants particularly hard because they’re often sent back to countries where they will face discrimination and lose rights they have in the US.

“In their home or their country, it’s too dangerous to be an out LGBTQ person. Their countries might have the death penalty [for LGBTQ people], on one extreme, or, on the other hand, they might simply not acknowledge that your family exists because of the lack of marriage equality,” Morris explained. “There are a lot of people who look to the United States as a beacon of understanding for LGBTQ issues. And in a lot of ways, it has become that — but only for a few people.”

While there are legal avenues for someone to obtain asylum in the US, the system just isn’t built to protect everyone. If someone can’t lawyer up and fight for years to get a case to a judge, he’s going to face very tough odds. “The system is stacked against an individual,” Morris said. “The government hires an attorney full time to oppose your ability to stay, and then you have to go by yourself in front of an immigration judge to convince them of the contrary.”

So while Immigration Equality has seen some successes in getting people asylum, it’s impossible to protect everyone when there are hundreds of thousands of deportations every year.

Obama tried to address some of these issues, signing executive actions that protected some undocumented immigrants during his time in office and pushing for Congress to pass comprehensive immigration reform. But overall, he still deported a record number of people — and that, Morris argued, leaves a big stain on his LGBTQ record. “It’s a tension,” he said.

These kinds of issues extend to immigration detention centers and the prison system. Again, the abhorrent conditions in these facilities are bad for just about anyone. But they are especially bad for LGBTQ people — and particularly trans women, who are often put in men’s prisons, where they face a huge risk of sexual assault and rape, just because they were designated male at birth.

Last year, for example, I covered the story of Samantha Hill, a trans woman who was repeatedly sexually assaulted and raped as she was carelessly shuffled around different federal prisons for men. And she isn’t alone: 24.1 percent of trans jail and prison inmates and 12.2 percent of non-heterosexual inmates report at least one sexual assault, compared with 1.2 percent of heterosexual inmates, according to a 2016 report by the Movement Advancement Project and Center for American Progress.

The Obama administration, again, took steps to try to fix this, such as stepping up its enforcement of the Prison Rape Elimination Act to protect LGBTQ people and building an immigration detention center exclusively for trans women. But these problems have persisted.

A separate failure, advocates said, is that the administration never interpreted federal civil rights law to protect people based on sexual orientation. The law clearly protects trans people, according to the administration. But the administration never acknowledged that sex discrimination bans as also include gay, lesbian, and bisexual people. (The theory is that if you discriminate against someone who’s gay, lesbian, bisexual, or in a same-sex relationship, it’s rooted in prejudices about whom people of certain sexes should love or be in a sexual relationship with — so it’s sex discrimination, which is banned in the workplace, housing, and schools, under federal law.)

Esseks, for one, said that “it is a disappointment.” But he’s confident that courts will soon enough finish the job and side with gay, lesbian, and bisexual people on this issue.

The Trump administration could make things worse for LGBTQ people

Obama’s LGBTQ legacy, however, has hit a huge hurdle in recent months: the upcoming Trump administration.

On the campaign trail, Trump attempted to brand himself as friendly to LGBTQ people — saying, although with some struggle, the acronym “L, G, B, T … Q” at the Republican National Convention.

But then Trump began nominating anti-LGBTQ politicians to his Cabinet. For attorney general, there’s Jeff Sessions, who once denied that LGBTQ people face discrimination at all. For the Department of Housing and Urban Development, there’s Ben Carson, who once called trans people “the height of absurdity.” And this all came on top of Trump putting on his ticket Vice President–elect Mike Pence, who has a long history of anti-LGBTQ positions, including claiming that preventing same-sex marriage is “God’s idea.”

For advocates, these nominees put to rest the idea that the Trump administration will be friendly to LGBTQ people. Simply put, it’s hard to imagine Sessions standing up on a podium and telling trans people, as Lynch did, that he sees them and will protect them — particularly when he doesn’t acknowledge that they face discrimination in the first place.

Still, we don’t have a full list of just how far a Trump administration will go. There have been hints that he would pull back Obama’s executive orders, but whether he would do that through a total repeal or by adding broad religious exemptions — maybe through legislation like the First Amendment Defense Act, which Trump supports — is unclear.

Still, adding broad religious exemptions to the executive orders “is basically the same thing as authorizing discrimination,” Esseks of the ACLU argued, because it could allow employers to cite their religious objections to LGBTQ people to excuse discrimination. “Nobody should be fooled if they go about the retrenchment that we all fear they want to accomplish through exemptions instead of repealing the equality protections wholesale.”

The Trump administration could also interpret and enforce federal laws to exclude LGBTQ people. It could interpret federal civil rights laws to not protect any LGBTQ people, including trans people in schools. A Sessions-led Justice Department might decide not to enforce federal hate crime law in cases that involve LGBTQ people. And so on.

And as bad as Obama may have been for LGBTQ immigration advocates, Trump looks poised to be worse — taking a “tough” stance on immigration on the campaign trail and promising to deport an additional 3 million people.

But there are limits to how much Trump could do. The Supreme Court seems unlikely to overturn the marriage equality ruling, since Trump would have to replace a liberal justice or centrist Justice Anthony Kennedy — right before a marriage case somehow works up to the Court — to overturn it. The federal hate crime law and repeal of “don’t ask, don’t tell” seem safe as well. (Trump’s nominee for the Defense Department, for one, said he has “never cared much about two consenting adults and who they go to bed with.”) And even in the areas where Trump acts, it might have a mitigated impact.

Consider the guidance for trans students in federally funded schools. Even if Trump repeals it, the guidance is still going to be around for schools that want to treat trans students right — and avoid legal challenges from LGBTQ organizations that would very likely sue should a school mistreat its trans students. A formal repeal doesn’t erase it as a non-binding advisory document.

Still, after eight years of Obama, the Trump administration will offer a massive change that LGBTQ advocates remain seriously worried about.

As Keisling of NCTE put it, “We have a president-elect about to take office who’s just openly disrespectful to Americans. This isn’t Americans who disagree with him; this is just Americans because of who they are. We don’t do that in this country — but this guy does.”