U.S. Sen. Dianne Feinstein took a lot of heat from the left wing of her Democratic Party by adopting a somewhat conciliatory attitude toward Donald Trump during the first year of his presidency.

As she launched a re-election campaign this year, her rival, Democratic state Sen. Kevin de León, depicted her as too soft on Trump and won the party’s official endorsement.

Even so, Feinstein had appeared to be on track to win her fifth full term, with nearly twice as much support as de León in a July poll by the Public Policy Institute of California.

WeeklyWalters: your Friday newsletter for all of Dan's columns.

Since then, however, Feinstein has seen her standing decline while de León’s has been rising and a new PPIC poll indicates that it could be a real race after all.

Feinstein’s lead among likely voters dropped from 46-24 percent in July to 40-29 percent in the latest survey, indicating that de León now has at least an outside chance.

While Feinstein still has a 2-1 lead among Democrats, her margin among independents is slight and Republicans actually seem to prefer the more liberal de León.

Feinstein, stung by her party’s rejection, ramped up her opposition to Trump this year, most recently by taking the lead in opposing Brett Kavanaugh’s nomination for the U.S. Supreme Court by releasing allegations of sexual misconduct.

Meanwhile, de León is trying to gain more traction among Democrats with a lavishly produced Internet video that depicts Feinstein as unfriendly to immigrants.

With actors portraying him and his mother, the video evokes the emotional trauma had she been hauled away by immigration agents, and recalled Feinstein’s long-ago support for harsher treatment of undocumented immigrants.

As she sought her first full Senate term in 1994, voters were also approving Proposition 187, which, if it had not been voided by the courts, would have cut off all public aid to undocumented immigrants.

Feinstein’s campaign aired a television ad, illustrated with shadowy figures, that accused rival Michael Huffington of being soft on illegal immigration.

“While Congressman Huffington voted against new border guards, Dianne Feinstein led the fight to stop illegal immigration,” the ad declared. In her own voice, Feinstein boasted of seeking more border guards, lighting and fencing.

The de León video contains two heavily edited snippets of Feinstein.

One, from 1994, has her saying, “The illegal immigrants who come here and commit felonies, that’s not what this nation is,” and then abruptly ends.

The second clip, from 1993, includes her saying, “I say return them to their own country, wherever that country may be,” then segues to a clip of Trump referring to immigrants as rapists.

When asked about the new video by the Los Angeles Times, de León replied that he wants voters to know that Feinstein has not made protection of immigrants a priority.

“You’re the ranking member of the judiciary committee, and you represent the largest state in the nation with the largest number of immigrants (and) you’re supposed to be the leading voice,” de León told the newspaper.

When she made opposition to illegal immigration a tenet of her 1994 campaign, Feinstein was aligning herself with the perceived mood of California voters that year. But that attitude has changed dramatically since then, and especially since Trump has made immigration one of his hot-button issues.

Feinstein is going with the current flow as she seeks another term, but de León is reminding voters of her political pirouette. It’s a legitimate hit, and one that could cut into Feinstein’s lead among anti-Trump, pro-immigrant Democrats.