North Carolina Republican lawmakers said late on March 29 that they had reached a compromise to repeal the state's controversial law prohibiting transgender people from using restrooms in accordance with their gender identities, following an ultimatum from the NCAA. (Reuters)

One of North Carolina's most controversial and high-profile laws in recent memory could be undone on Thursday.

On Thursday, the GOP-controlled state senate approved a repeal of the state's "bathroom" bill, which limits which restrooms transgender people can use and prohibits municipalities from passing LGBT protections. North Carolina is the first and so far only state with this kind of law (though Texas is considering its own).

The deal was struck with North Carolina's Democratic governor, Roy Cooper. It's not clear whether lawmakers have the votes to roll back the law in the state house, but the urgency is on. NCAA gave North Carolina until Thursday to repeal the law or be blocked from holding any tournament in the state for the next six years. A recent Associated Press review found the law could cost the state upward of $3.7 billion in sports/entertainment and business revenue over the next 12 years.

This isn't the first time lawmakers have tried to repeal the law. Here's a look at the tumultuous history of North Carolina's “bathroom” bill.

The North Carolina legislature met for a special session on Dec. 21 over the state's much-criticized House Bill 2, which opponents say discriminates against transgender people, but did not repeal the controversial "bathroom law." (Peter Stevenson/The Washington Post)

February 2016: Charlotte passes LGBT protections ordinance

In February, the Charlotte City Council voted 7 to 4 to approve legal protections for LGBT people. The bill aimed to prohibit businesses, bars, restaurants, stores and taxis from discriminating against gay or transgender customers. (There is no federal law prohibiting LGBT discrimination.)

But here's the really controversial part: The ordinance also allowed transgender residents to use the public bathroom designated for the gender they identify with, regardless of the gender on their birth certificate.

In Raleigh, the Republican-controlled legislature threatened to override the law. Allowing men into women's bathrooms and locker rooms puts young people, particularly girls, at risk of sexual predators, conservatives argued.

March 2016: State legislature voids Charlotte LGBT law

Charlotte kept the ordinance, and Republican lawmakers made good on their threat. They called a special session, and, in a matter of hours, introduced and passed a bill that voided Charlotte's entire nondiscrimination ordinance.

The state law's reach caught many Democrats off guard. Instead of just repealing Charlotte's ordinance, it prohibited any North Carolina municipality from passing an LGBT anti-discrimination ordinance. Most controversially, North Carolina became the first state in the nation to require transgender people to use public bathrooms and locker rooms of the gender on their birth certificate.

Here's then-Gov. Pat McCrory (R), who narrowly lost reelection to Cooper in 2016:

March — rest of 2016, pretty much: All hell breaks loose

North Carolina Governor Pat McCrory (R) defended the state's controversial bathroom law on May 9, asking Congress to weigh in. (Reuters)

Just like that, North Carolina became ground zero for the heated battle over gay and transgender rights.

Bruce Springsteen canceled a concert there. The NBA and the NCAA relocated major games and tournaments out of the state.

Some of the biggest names in business sports also came out against the law. PayPal pulled out of a plan to expand in Charlotte, just weeks after McCrory publicly revealed the expansion. The chief executives of Apple, Google, Hilton and Starbucks wrote an open letter to the governor criticizing the law. Tourism groups estimated that the state was losing hundreds of millions of dollars in investment because of the law's unpopularity.

A looming reelection battle for McCrory suddenly seems more competitive.

April 2016: McCrory tries to walk back the law (sort of)

Amid the backlash, McCrory's approval numbers fell. In April, he announced he had “come to the conclusion” that an executive order was necessary related to the law. But The Washington Post's nonpartisan fact-check team found that the executive order did not substantially change the law.

I wrote at the time: “The whole thing gives the appearance that McCrory has backed down under pressure, but it’s unlikely to actually alleviate any pressure on him.”

May 2016: North Carolina, U.S. government sue each other

The Justice Department's civil rights office filed a lawsuit against the state, claiming that the law violated transgender people's civil rights. In an impassioned speech that surprised even gay rights advocates, Attorney General Loretta E. Lynch — a North Carolina native — compared the bathroom bill to the Jim Crow laws of her childhood. The Obama White House called the law “mean spirited.”

The Education Department said it was reviewing whether to withhold some of $4 billion in federal funding (much of it in the form of student loans) because of the bathroom bill.

McCrory accused the federal government of “baseless and blatant overreach,” and his office filed a counter lawsuit.

Civil rights groups also filed lawsuits against North Carolina. Two months after the law was passed, everyone was suing everyone.

November-December 2016: McCrory loses reelection

In a race that took more than a month to settle, McCrory lost to Cooper by slightly more than 10,000 votes out of more than 4 million cast.

He was the first North Carolina governor ever to lose reelection, and some political observers think the bathroom law played a role in his loss.

“He kind of became the spokesman of it,” University of North Carolina law professor Michael Gerhardt said.

December 2016: McCrory signs law limiting successor's power

In a last-minute special session held last week, North Carolina Republicans created more controversy when they introduced and quickly pushed through bills that would significantly curb Cooper's power.

Democrats derided it as a “power grab.” The session was not directly related to the bathroom bill, but it did manage to put North Carolina Republicans in the scrutiny of national headlines twice in one year.

Also December 2016: A botched repeal effort

On his way out the door, McCrory announced a special session to repeal the law that may have cost him his job.

Under a deal engineered behind the scenes by incoming governor Cooper, Charlotte's city council voted to get rid of their law giving LGBT people legal protections, like using the public bathroom of the gender they identify with.

Republicans say Charlotte's nondiscrimination ordinance started this whole thing in the first place. Now that the Charlotte ordinance is gone, they said, the overarching state law prohibiting ordinances like Charlotte's is no longer needed.

But not every Republican was on board with the repeal, and there was some confusion about whether Charlotte's entire nondiscrimination ordinance was really repealed. In the end, Charlotte's ordinance went off the books, but the bathroom bill's repeal efforts crashed and burned and the state law stayed in place.

February 2017

The North Carolina sports association warned lawmakers that the NCAA could soon block North Carolina from holding any college championships in the state, a move that a state sports official said would effectively close the door to any NCAA business. (The NCAA already skipped North Carolina for its 2017 March Madness college basketball tournament.) North Carolina is synonymous with college basketball, so it's hard to understate how politically and economically devastating this would be for the state.

“It's hard to put a dollar figure on it, but I'm really not sure I need to know exactly what the dollar figure is to figure out the state is hurting,” says GOP state Rep. Chuck McGrady, who struggled to come up with a repeal coalition.

March 2017

It's March Madness, and UNC and Duke are playing their tournaments across the border in Greenville, S.C. A rabbit show is still going on in the North Carolina town normally buzzing with basketball this time of year. North Carolina lawmakers have until the end of the month to repeal the law, or this will be their reality for at least the next six years.

March 30, 2017

Cooper and GOP lawmakers announce they have a deal. It would prohibit any city from passing an LGBT nondiscrimination ordinance through 2020, a compromise between Republicans who want to prevent another Charlotte from opening up public bathrooms to transgender people, and Democrats who want to allow cities to pass their own nondiscrimination protections.

It remains to be seen if the repeal effort has the votes.

This story was originally published in December, when a repeal effort fell through. It has been updated.