CREWE, Va. — Rep. Abigail Spanberger dismissed threats to stick with the party or face a primary challenge in 2020, declaring she wouldn’t be cowed from working with Republicans.

The Virginia Democrat has voted with Republicans on some initiatives and met with President Trump in an attempt to negotiate a way out of the recent government shutdown.

That contrarian streak, despite voting with the party on major legislation, has elicited a scolding from House Democratic leaders and 29-year-old Rep. Alexandria Ocasio-Cortez, D-N.Y., who has threatened to recruit primary challengers to run against centrist Democrats.

Spanberger practically dared her to try in remarks to reporters following a town hall meeting with constituents in Nottoway County, in the southern end of the 7th Congressional District, a swing seat she captured last November after ousting a Republican incumbent aligned with Trump.

“I can have colleagues threaten me as much as they like but I’m going to continue serving my district in the way that I think is important. And, I’m going to continue serving in Congress in a way that I think is important and that does not mean falling in line on every single vote,” Spanberger said, after addressing a polite crowd of about 100 on the campus of a local high school in rural Southwestern Virginia.

“If somebody from a super-safe blue district, or super-safe Democratic district, wants to have a problem with that, I welcome them to come with me to one of my town halls and listen to the things that people are talking about,” she added.

Spanberger, 39, a former clandestine officer in the Central Intelligence Agency, is liberal on key issues. She supports amending Obamacare to implement a government-run public insurance option, backs strengthening background checks for gun purchases, and she backed Democratic legislation to overhaul federal elections, the centerpiece of the party’s agenda in the House.

The Republicans in Spanberger’s district are giving her grief for it, too.

During the town hall meeting Tuesday evening in Nottoway County, in the Republican-leaning, southern end of the district, the congresswoman was asked about Trump’s proposal to build a wall spanning much of the Mexican border, her plans fixing an expensive healthcare system they blame on the Affordable Care Act, and whether she supports removing Rep. Ilhan Omar, D-Minn., from the House Foreign Affairs Committee for comments widely condemned as anti-Semitic.

Spanberger said she agreed that Omar’s provocative remarks were anti-Semitic, but noticeably hesitated on the question of whether she should be removed from the plum committee. (Later, Spanberger told reporters that she did not believe her fellow freshman from Minnesota should lose the assignment, in part because she has shown contrition.) But it was the explanation she gave for opposing Trump’s wall that fell particularly flat.

Spanberger said her border security policy is informed by discussions with federal law enforcement officials. That wasn’t good enough for Peter Hasso, 72, a retired business executive and self-described independent who voted for Trump and thinks he’s doing “a great job.” Hasso asked the congresswoman about the wall.

“What bothered me is, she evaded the issue of the wall. I know all the bit about drones and everything else. But walls have been proven that they work,” Hasso said, echoing the president.

Still, Spanberger kept her word to oppose House Speaker Nancy Pelosi, D-Calif., in leadership elections earlier this year, and she has joined the Problem Solvers Caucus, a bipartisan group. That has surprised some Republicans in the area, who expected Spanberger to conveniently abandon her pledge to oppose Pelosi, and work across the aisle, if she got elected.

“Her issue that got her elected was, 'I’m going to be accessible, I’m going to listen to everybody.' And, so far, from what I can observe, she’s definitely practicing that,” said Blackstone Mayor Billy Coleburn, another local Trump supporter.