Sen. Dianne Feinstein's decision to seek a sixth term in theory leaves her open to a fierce challenge from someone closer to the ascendant and most vocal voters in a party that has moved sharply to the left and begun a generational shift.
Feinstein has long straddled two camps in California, demonstrating enough liberal tendencies to attract a majority of Democrats and enough moderate ones to be acceptable to those in the middle of the political spectrum. Early in her career, for example, she gained credit among moderate voters by drawing boos from a crowd of liberal party activists when she said she favored the death penalty in some cases.
In recent years, that sort of straddle has become an increasingly difficult posture to maintain.
The leftward move by Democrats has been matched by a Republican shift to the right, leaving fewer voters to occupy the moderate middle on which Feinstein has depended. This year, she has come under loud public criticism from liberal activists for refusing to endorse a single-payer healthcare plan and other goals.
Most recently, she was blistered by her party's left for uttering what appeared to them to be a heresy, telling a San Francisco audience that she still had hope President Trump could be a "good president" and counseling patience rather than agitating for impeachment.
For all that, she remains at this point the favorite to win, for reasons central to her record and to the state's complicated politics.
Garry South, who managed the successful campaigns of another moderate, former Gov. Gray Davis, said Feinstein's comments about Trump, in particular, opened the door to a challenge.
"In the last 10 years, Democratic voters have moved substantially to the left," he said. "There are a lot of challenges, but I think the chances she draws a Democratic opponent are far better today than before her remarks in San Francisco."
Still, he said, "I don't know that all of this means there's a perfect storm awaiting Dianne Feinstein."
Potential challengers circled Feinstein on Monday after she made her announcement.
State Senate leader Kevin de León, who represents a central Los Angeles district, released a letter to supporters that emphasized his resolve in actively taking on Trump — a suggestion that Feinstein had not. De León has not officially announced a candidacy, but word that he might do so soon was believed to have played a role in Feinstein's abrupt announcement.
"I fully intend to stand with the millions of Californians who are committed towards action in the fight for our nation's soul," he wrote.
Another potential challenger, Los Angeles entrepreneur Joseph Sanberg, let loose a string of tweets that similarly appeared aimed at Feinstein.
"Here at home, Californians are leading the resistance to bullies like Trump," he tweeted. "But we need representatives willing to do the same in DC."
The party's leftward shift makes those potential challenges more serious. In 2011, the year before Feinstein's last race for the Senate, 52% of Democrats characterized themselves as liberal, according to polling by the Public Policy Institute of California. In a recent poll, that number had jumped to 61%.
This year, the race to lead the state party was upended when establishment leaders found themselves under siege from younger and more liberal activists, who mounted a challenge to the party chairmanship that nearly succeeded and contributed to angry public fights during a party convention.
The change has been fueled in part by the 2016 challenge to the Democratic establishment mounted by Vermont's independent senator, Bernie Sanders. Sanders energized younger voters, in particular, and remains a lodestar to them. It is his plan for universal insurance coverage that Feinstein declined to endorse.
But Sanders' presidential race offers other reminders that, however powerful the ideological and generational change may be, California's politics still hew in Feinstein's favor.
Hillary Clinton won the California primary handily despite the energy apparent in Sanders' campaign. She did so by relying on the same set of voters who have powered Feinstein's races since her first Senate contest in 1992.
Among Democratic voters, the Public Policy Institute polling found, 62% are women, historically big supporters of the senator. And most are older, requiring any challenger to employ a deft hand when trying to knock off a veteran who was the first woman to represent the state in the U.S. Senate. A candidate seeking to make an issue of Feinstein's age, 84, would risk a backlash.
Another potential advantage for Feinstein: Voters in California have tended to define liberalism by many topics, not just healthcare. (Indeed, the state's popular Democratic governor, Jerry Brown, is among party leaders who share her moderate views on healthcare.)
Feinstein's image as a centrist belies a vast record that in any other state would be considered reliably liberal.
Shortly after her arrival in the Senate, she pushed through a ban on assault weapons, one that lapsed during the Bush administration and has not been renewed since. The issue has now taken on greater prominence once again because of the Las Vegas massacre. Feinstein speedily moved last week to ban devices that can turn semiautomatic weapons into functionally automatic ones.
Feinstein also was the prime mover behind forcing into public view a review of CIA interrogation tactics. That battle strained her relations with Obama administration national security officials but put her in the company of liberals seeking to ban torture.
Feinstein also has constructive organizational advantages: She is better known in the state than any figure who might challenge her, an important factor in a place where television advertising costs millions per week. She has an existing national fundraising network, whereas others would have to build one from scratch.
She also has allies, including prominent figures on the party's left. Sen. Kamala Harris, who is far more popular than Feinstein among liberals, swiftly endorsed her after the announcement Monday, as did Rep. Adam B. Schiff of Burbank, who has emerged as one of Trump's main antagonists in Congress.
"We are better off with her leadership," Harris wrote.
While opponents see Feinstein's style and longevity as a negative, her backers see it otherwise.
Her longtime campaign strategist, Bill Carrick, ticked off a string of issues — guns, abortion rights, desert protection, environmental issues, torture, LGBT rights — on which Feinstein's record is closely aligned with the most liberal elements of the party.
"She's in good shape, and the Democratic base is her strength," he said. "Anybody who thinks they're going to run to the left of her with Democrats, good luck."
Ultimately, the race may center on what Californians expect of their politicians. Feinstein, a former San Francisco mayor, is a believer in the school of compromise, of both sides working together to achieve an end that fully satisfies neither but moves the issue along.
"I can work across the aisle. I can work with other people. I know how to make judgments that can make bills passable," she said in a brief interview after her announcement.
That is a style that has gone broadly out of fashion in recent years. If a challenger with enough money and manpower arrives, the Senate race could foretell whether California voters still want it — or prefer a more antagonistic tone. Feinstein is betting that's not the case.
"I'm not a rabble-rouser; it's not what I intend to do," she said after a frequently testy town hall in mid-April at Los Angeles' First African Methodist Episcopal Church. "I want to try to dim the cry and to fashion it into something constructive.… I think people want me to be constructive."
Staff Writer Sarah D. Wire contributed to this article.