Katie Porter, a consumer law expert and former student of Sen. Elizabeth Warren (D-Mass.), flipped a GOP-held seat in California’s traditionally Republican Orange County.

Because so many California voters cast their ballots by mail or through absentee voting, the final outcome of the race was decided more than a week after Election Day. Porter initially trailed her opponent, but the ballots counted after Nov. 6 skewed toward her.

Porter benefited from the backlash to President Donald Trump among moderate suburban voters in California’s 45th Congressional District ― one of seven Republican-controlled California House seats where Hillary Clinton won in 2016.

She ran as an unabashed proponent of Medicare for all, expanded Social Security and tough banking rules, but emphasized issues with broad appeal: the damaging effect of the Republicans’ tax cuts and effort to repeal the Affordable Care Act, tougher gun laws and women’s reproductive rights.

“The electoral tide almost always pulls against the president’s party during his first midterm election, and this year’s tide was especially strong because President Trump has been especially divisive,” said Matthew Beckmann, a political scientist at the University of California, Irvine. “Porter’s campaign ― focused on unifying Californians and checking President Trump ― was pitch perfect for riding this national wave all the way from a Republican district in California to the seat of power in Washington.”

RELATED COVERAGE An Elizabeth Warren Protégé Is Defying The Odds In The Cradle Of California Conservatism

Porter, a 44-year-old law professor at UC Irvine, defeated two-term Rep. Mimi Walters (R), 56, a former investment banker who served in House Republican leadership.

Walters, who was registered to vote in another district as recently as June 2017, drew criticism from some constituents for her lack of accessibility and declined to make any joint appearances with Porter.

And unlike some other Republicans in vulnerable seats, Walters stuck with Trump on his two major legislative initiatives ― the failed bid to repeal the ACA, as well as the tax cut bill that became law.

Although California’s 45th is an affluent district, the tax law’s near-elimination of the state and local tax, or SALT, deduction made it a net tax hike for many of the district’s upper-middle-class residents. Porter’s support for reinstating the deduction earned her the backing of the influential California and National Realtors Associations, which spent heavily on her behalf.

Porter also bucked the California Democratic Party by declaring her intention to vote for a ballot initiative repealing a modest gas tax levied by the Democratic-run state government to fund infrastructure improvements. She argued that Orange County residents had already been hit hard by the federal tax law and that infrastructure funds could be secured through other means.

Porter typically eschews labels, but she told HuffPost that she plans to join the Congressional Progressive Caucus and the Medicare for All Caucus. She is critical of some Democrats’ support for legislation that rolled back oversight of many large banks, and said she hopes to serve on committees that allow her to apply her expertise in financial policy.

Porter, who collaborated with Warren in studying the impact of health care costs on household bankruptcies, was one of just two candidates who Warren endorsed in the Democratic primaries. Warren, who cruised to re-election on Nov. 6, was also an early backer of former Consumer Financial Protection Bureau Director Richard Cordray. Cordray fell short in his gubernatorial bid in Ohio.

“A Porter victory shows that Sen. Warren’s message plays not only in a place you think a populist message can succeed like Ohio where Sherrod Brown has used it to great effect, but in affluent districts like Orange County,” said Jeff Hauser, executive director of the Center for Economic and Policy Research’s Revolving Door Project who previously worked as a strategist at the AFL-CIO.