For Democrats running in red or purple territory, winning races in the age of Donald Trump means positioning themselves as centrists.

But for some, it also means shedding – or downplaying – their past liberal activism, donations and comments.

Perhaps nowhere is this shift more apparent than in Arizona, where Democrat Kyrsten Sinema is locked in one of the country's closest Senate races with Republican Martha McSally.

STATE OF THE MIDTERMS: ANALYST PREDICTS BIGGER HOUSE GAINS FOR DEMS AS PELOSI EYES GAVEL

In this contest, Sinema has cultivated an image as a moderate Democrat in a red state – for example, she has said Immigration and Customs Enforcement holds an "important function" even as progressives call for abolishing ICE.

But it wasn’t long ago that she was a Ralph Nader-supporting, pink tutu-wearing Iraq War protester who referred to herself as a “Prada socialist” in 2006. She first ran, and lost, a state legislative race in 2002 on Arizona’s liberal Green Party ticket.

Republicans have zeroed in on Sinema’s past activism to paint her as much more liberal than she portrays herself.

“While we were in harm’s way in uniform, Kyrsten Sinema was protesting us in a pink tutu and denigrating our service,” McSally, a retired Air Force fighter pilot and a member of Congress, said in a memorable television ad.

In recent weeks, Sinema has sustained a steady stream of revelations that she made past critical comments about her state, including once jokingly referring to Arizona as the “meth lab of democracy” in 2010. Sinema in 2011 implied that her home state produced "crazy" in a speech in which she also promised to advise liberal activists how to "stop your state from becoming Arizona."

A Sinema campaign spokesman did not return a request for comment. But in a recent interview with the Atlantic, the Democratic congresswoman said she appeals to voters from multiple parties.

“Folks are so excited … that we’re attracting support from Democrats, Republicans, and independents,” Sinema said. “In Arizona, folks don’t really care what letter is behind your name.”

The most recent Fox News Poll shows Sinema and McSally tied at 46 percent each.

Others running as more centrist Democrats include Missouri Sen. Claire McCaskill, the incumbent senator who is fighting to keep her seat from Republican Josh Hawley. McCaskill, who voted against Brett Kavanaugh’s nomination for the Supreme Court, emphasized this week that she often supports President Trump's nominees.

“I voted for over 70 percent of President Trump's judicial nominees 70 percent -- 70 percent,” McCaskill told Fox News’ Bret Baier. “I voted for more than half of his Cabinet members. I vote with him half the time. He's signed 38 of my bills into law.”

McCaskill also backed up Trump, who has called for stopping the caravan of 4,000 Central American migrants headed toward the United States.

“I think the president has to use every tool he has at his disposal,” McCaskill said. “And I 100 percent back him up on that.”

Further, she distanced herself from what she calls "crazy" Democrats.

But her Republicans opponent called her comments “a bunch of nonsense.”

“I mean, this is somebody who votes with Chuck Schumer 90 percent of the time,” Hawley told Fox News' "America's Newsroom." “When it comes to Brett Kavanaugh, Justice Gorsuch, tax cuts, immigration, tariffs -- Senator McCaskill has been against this president and against our state on every issue that matters. Not just this last year, but now for 12 long years.”

It’s not just Senate races: in Washington state, Democrat Lisa Brown is running a competitive challenge to Rep. Cathy McMorris Rodgers, a member of the House GOP leadership.

The Washington Free Beacon reported that Brown, a former state legislator and chancellor of Washington State University Spokane, founded a socialist bookstore in the 1970s. According to the outlet, that bookstore's Facebook page describes the Left Hand Book and Record Collective today as "Boulder's one-stop-shop for all socialist, resistance, revolutionary, radical, alternative, and anti-capitalist literature."

There have also apparently been efforts to downplay the Democrat’s background: Media consultants for Brown attempted to edit her Wikipedia page to remove mentions of her travels to Nicaragua and Cuba, the Free Beacon reported.

Brown's campaign told Fox News such stories amount to "red-baiting."

"These 'red-baiting' stories are obviously misleading and desperate attempts in a close race to distract people from the top issue people care about in eastern Washington, which is health care," Brown spokesman Keeley Smith said.

But McMorris Rodgers spokesman Jared Powell shot back: “People in Eastern Washington want freedom, opportunity, self-determination, and free markets. Lisa Brown does not reflect those values, and she will go to any length to try and hide from her long and radical record.”

Other Democrats have made dramatic announcements to show they can be bipartisan: Phil Bredesen, running against Republican Marsha Blackburn for the Senate in Tennessee, announced last month he would back Trump’s choice of Kavanaugh for the Supreme Court – even as all but one Democrat in the Senate opposed his confirmation.

“Presidents have the right to appoint justices who share their values–elections have consequences. I believe a Senator’s responsibility to ‘advise and consent’ is not a license to indulge in partisanship, but should focus on the qualifications of the nominee, their ethics and their temperament,” Bredesen said at the time.

Still, Bredesen -- the wealthy former Democratic governor of Tennessee – has given generously to top Democrats over the years: He shelled out about a half-million to liberal politicians before running for the Senate, including for the Democratic presidential campaigns of Bill Clinton, Al Gore, Barack Obama and Hillary Clinton.

Fox News’ Brooke Singman contributed to this report.