EASTPORT, Maine — Sen. Susan Collins believes that the basics still apply: Maine still wants a moderate senator in Washington.

Her opponents are pushing a different line: She is the one who changed and abandoned New England’s traditional moderate GOP roots in the era of President Trump.

That battle was on display throughout Independence Day celebrations in the country’s easternmost port town, as the veteran senator darted across a two-mile route in this state’s most storied Fourth of July parade, shaking hands, posing for pictures and hearing an occasional jab about Trump’s immigration policies or her vote for Supreme Court Justice Brett M. Kavanaugh.

On the east end of Washington Street, Collins heard a howling cheer from Kari Lancaster, 48, a mother of eight who professed having a deep connection to the senator. “She’s the only politician that I believe in, I trust her. She’s relatable, she’s personable,” Lancaster said. “She maintains her roots here. It seems like she really cares about us.”

Just a few blocks before, however, Terry Greenhalgh called Collins over to demand she stand up to Trump’s policies on migrant detention centers. “It’s our president, we’ve got to get him out,” Greenhalgh, 72, told the senator.

“No, we’ve got to get the children out,” Collins replied, declaring support of better conditions for the migrant children.

“No, we’ve got to get him out too,” Greenhalgh said, explaining later that she would no longer support the senator.

Afterward, Collins, 66, dripping with sweat from an unusually warm day in a town across the bay from Canada, deemed the event successful enough that she leaned further into formally announcing her reelection bid.

“I had one man say, ‘Don’t you dare quit; don’t you dare leave us.’ As I’ve said, I’ll make my final decision in the fall,” she said, “but this certainly was an encouraging day.”

Moderate New England Republicans were a still thriving breed in 1996, when Collins first ran for the Senate, with more than a dozen in Congress. Now, as she prepares for her 2020 race, Collins is the only New England Republican left, House or Senate, trying to survive in times when partisan loyalty is put to the test even in this traditionally independent-minded state.

No one has whipsawed across the hyperpartisan landscape quite like Collins.

On July 4, 2017, she also marched in the Eastport parade, hailed then as a hero by liberals for her opposition to the Trump-led bid to repeal the Affordable Care Act. By the fall of 2018, as she cast the most critical vote for Kavanaugh, liberal activists declared her a turncoat and vowed to defeat her bid for a fifth term.

They raised more than $4 million for a political committee that will be handed over to Collins’s Democratic opponent, most likely the state House speaker, Sara Gideon, who announced her bid the last week of June and immediately raised more than $1 million of her own funding.

Collins will be on the ballot next year with Trump, in a state where no GOP presidential candidate has crested 45 percent since 1988, making this race a must-win for Democrats to have any chance at recapturing the Senate majority.

But local Democrats understand how heavy a lift it will be to defeat Collins. People in Maine have long had a unique affection for their politicians, particularly U.S. senators. They expect big things of senators and want them to be at the center of Washington’s attention. The alumni group includes a Senate majority leader and two who went on to serve as secretary of state and secretary of defense.

Over the past 40 years, no Maine senator or governor has lost a reelection bid.

Anne Stanley, a retired Episcopal priest who has long opposed Collins, greeted the senator at Thursday’s pancake breakfast at the municipal airport by imploring her “to express great outrage” over the detention centers for migrant children.

The senator explained her support for an emergency $4.6 billion border crisis bill, but Stanley, 78, still expressed doubt that Collins would fully “separate herself” from Trump.

But she noted how much natural affection Mainers have for senators: “We know our politicians. We see our politicians.”

Collins believes her 2008 reelection win provides a road map for success again. Then, as the Iraq War grew deeply unpopular and the economy collapsed, a well-funded six-term congressman tried to unmask her as a reliable GOP vote for George W. Bush’s tax cuts, his Supreme Court justices and war funding.

In a year Republicans lost eight Senate seats, Collins won her race by a stunning 23-percentage-point margin.

“What I noticed in that race is that once again they tried to paint me as someone I wasn’t,” Collins said in a 30-minute interview at the Eastport Port Authority, noting various studies that show she remains the most bipartisan senator. “The people in Maine know me very well, they know that I’m independent.”

Her idol, Margaret Chase Smith, and her mentor, William S. Cohen, previously held this Senate seat. Both made history by standing up to fellow Republicans — Smith, opposing Joseph McCarthy’s communist witch hunt; and Cohen, by supporting impeachment of Richard M. Nixon as a first-term member of the House.

A young Susan Collins worked for Cohen, instructed by senior staff to never throw anything away. So over the spring and summer of 1974, Collins collected a pile of stones at her desk, all from Nixon supporters who sent them with notes saying only those without sins could “cast stones” at the president.

Almost 45 years later, Collins found herself in a similarly heated time as she became the most pivotal vote in favor of Kavanaugh’s confirmation after allegations emerged of an attempted sexual assault when he was in high school.

A Long Island man was sentenced to 18 months in federal prison last month after threatening to kill Collins if she voted yes; a neighbor on Capitol Hill called her a “rape apologist” on the morning of the vote.

Across Eastport on Thursday, there were some signs of lingering anger over Kavanaugh — people who wanted Collins to have had a Smith-Cohen-like moment opposing Republicans.

“We got Kavanaugh in, and we want those kids out of those cages,” Greenhalgh said, angry about the detention centers. “She’s going to lose her job if she doesn’t do something to help those kids.”

Other attendees thanked her for pressing the Pentagon to send a Navy destroyer to dock here for the holiday weekend. Collins is ready to run on experience and stature, keenly tracking every dollar Maine has received ($162 million so far) in highway grants since she took over a transportation funding subcommittee.

She is betting that local issues still matter, but other New England Republicans found out the hard way, at some points, all politics can become national.

“Over the years they’ve been either defeated, retired or died,” Collins said. “And those don’t seem like great options right now to me.”