It all started with a wave.

The 2010 elections — the first midterms during the Obama presidency — were cause for celebration for Texas Republicans. They picked up almost two dozen seats in the state Legislature and ousted a 27-year incumbent Corpus Christi Democrat in a South Texas congressional district he had represented since its creation in 1982.

The timing of that fluke win in the 27th Congressional District was just right for Republicans. State lawmakers would soon embark on redrawing Texas’ political maps following the once-a-decade census. Now, Republicans could reconfigure CD-27 to protect their new incumbent, Blake Farenthold.

To accomplish that, Republicans redrew the district in 2011 in a way that left behind Democratic-leaning areas in the district and picked up swaths of the state they could rely on to vote Republican the following year. But those efforts curtailed CD-27’s Hispanic majority, which had long supported Solomon Ortiz. The decision-making behind the redrawing of CD-27 would ultimately usher in a seven-year-long legal fight over the rights of Hispanics living along the state’s coastal bend — the next chapter of which takes place this month at the U.S. Supreme Court.

General election results, winning candidate → Area shown ↑ on maps Scroll to see more maps → The shades of blue and red show how strongly CD-27 voting districts went Democratic or Republican. Voting districts from the U.S. Census. District shapes and election results from the Texas Legislative Council. View the analysis we ran to get this data.

The 2011 changes to the congressional district anchored in Nueces County were drastic. Unlike other districts where lawmakers carefully traveled block by block to pull in the voters they wanted, CD-27 was practically flipped on its head.

This is an occasional series about how Texas leaders choose their voters — using gerrymandering and voter ID laws — as courts repeatedly scold them for disproportionately burdening voters of color. More in this series

With a majority Hispanic population, the district had long been configured to stretch down the coastal bend into the Rio Grande Valley and was considered an opportunity district where Hispanic voters would be empowered to elect their preferred candidates. It was also reliably blue — election after election, voters backed Ortiz.

And while Farenthold squeaked by with a 2010 election win, it was unlikely that the Hispanic voters who made up the majority of CD-27’s electorate would support the Republican incumbent in the next election — a presidential year — when turnout would be higher.

In an effort to draw a district that would be friendlier to Farenthold, map drawers pulled more than 100,000 Hispanics of voting age out of the district and kept Nueces County in CD-27 because that’s where Farenthold lived. That reconfiguration resulted in a district that starts in Nueces County, runs north along the coastal bend and reaches into Central Texas. It’s a district, map drawers concluded, that would keep Farenthold in office.

But it would also run afoul of the federal Voting Rights Act.

Scroll to see more maps → The shades of blue and red show how strongly CD-27 voting districts went Democratic or Republican. Voting districts from the U.S. Census. District shapes and election results from the Texas Legislative Council.

As part of a legal challenge to several congressional and legislative districts, a three-judge federal panel ruled last year that Republicans violated federal protections against discrimination for voters of color by diminishing the political clout of Hispanics in Nueces County.

The Texas Tribune thanks its sponsors. Become one.

Cataloging their actions as discriminatory, the judges found that Republican lawmakers intentionally deprived Hispanic voters of their opportunity to elect the candidate of their choice in CD-27. Republican lawmakers placed Nueces County Hispanics into a district “dominated” by white voters “not because they wanted these Hispanic voters to have influence in CD-27” but because those voters wouldn’t support the Republican incumbent, who is white, the judges wrote.

Ultimately, more than 200,000 Hispanics in Nueces County were “stranded” in CD-27, which picked up several central Texas counties.

Scroll to see more maps → Overlay on maps represent census tracts, which are from the U.S. Census. Voting-age population data from the Texas Legislative Council.

The new political map left Nueces County as the only county in CD-27 with a majority Hispanic electorate, but that majority was essentially drowned out in the overall district, where the share of Hispanics who were of voting age dropped to 45 percent.

Because voting blocs are often aligned along racial groups that prefer different candidates, it would be virtually impossible for Hispanic voters to overcome the white voting bloc in electing the district’s representative.

In flagging CD-27 as discriminatory, the judges pointed to testimony that showed map drawers knew this wasn’t necessary.

Map drawers acknowledged that they could have included part of Nueces County — and most of its Hispanic population — in a neighboring district that was majority Hispanic in a way that still would have protected Farenthold and kept his home in the district. But they put aside alternative maps that did just that and instead made the “political decision” to put all of Nueces County into the new CD-27 with its majority-white electorate, the judges found.

Scroll to see more maps →

Key to this calculation was the need to include seven Hispanic opportunity districts in the area known as the south and west Texas “envelope” to comply with the Voting Rights Act.

The Texas Tribune thanks its sponsors. Become one.

For decades, Nueces County had been included in the envelope, which was made up of districts where Hispanics made up a majority of eligible voters. It ran from Nueces County to El Paso, up to Central Texas and back to Nueces. But the latest iteration of the state’s congressional map nixed the county from that configuration.

Nueces County’s eviction is perhaps best highlighted by the boundaries of the neighboring 34th Congressional District, which was carefully drawn to bypass Nueces County and pick up residents from less-populated counties farther north to meet population requirements.

Scroll to see more maps →

According to the judges, the voting rights violations rooted in Nueces County stretched far northwest into Travis County — home to Austin — where lawmakers pulled Hispanic voters into another neighboring district, the 35th Congressional District, that they labeled as a Hispanic opportunity district.

After the 2010 census, Texas Republicans were forced to grapple with the reality that Hispanics — who tend to vote for Democrats — were behind most of the state’s explosive population growth, and map drawers at the time acknowledged needing to add one Hispanic opportunity district.

Now that CD-27 was no longer a Hispanic opportunity district, they turned to CD-35 as a key piece to their redistricting strategy. But CD-35 proved to be a “facade” opportunity district that reduced Hispanic voting power statewide, according to the federal judges.

Opportunity districts are meant to be drawn in places that are home to racially polarized voting, where whites vote as a bloc against candidates preferred by voters of color. That electoral dynamic does not exist in Travis County, so Hispanics there weren’t entitled to reside in an opportunity district under the Voting Rights Act, the judges found.

Hispanics in Nueces County, on the other hand, were entitled to that right, but in the end, their rights were “essentially traded” away.

Want to learn more about Congressional District 35? As part of our Lock The Vote series, we examined another key piece of Republicans’ 2011 redistricting strategy, which courts said discriminated against minorities: the curiously-shaped 35th Congressional District.

The state has since appealed the lower court’s ruling to the U.S. Supreme Court, which is set to hear arguments in the case on April 24.

The Supreme Court’s decision on whether lawmakers discriminated against Hispanics in drawing up the two districts is expected this summer. If the high court sides with the lower panel’s decision, it could find that, for a majority of this decade’s elections, Hispanic voters in CD-27 were intentionally placed in a district in which they had less power to elect their representative.

By then, the state will be just months away from Election Day, which will officially mark the fourth congressional election conducted under that map.