Rep. Darrell Issa (R-Calif.) speaks as people hold up signs during a town hall meeting at the Junior Seau Beach Community Center in Oceanside, Calif., on March 11, 2017. (Hayne Palmour IV/AP)

For three hours Saturday, Rep. Darrell Issa (R-Calif.) endured pointed questions, jeers and derisive laughter during two successive town halls in this northern suburb of San Diego.

But this wasn’t just a moment for Issa to let anxious constituents vent their worries about immigration policy, health-care reform or the first seven weeks of President Trump’s tenure. It was a major first test of the Democratic Party’s efforts to turn antipathy toward Trump into electoral gains in 2018. It was also a chance for Issa to show that he is willing to stand apart from Trump for a district that has rapidly grown more liberal in recent years.

“I do not work for the executive branch,” Issa said in an opening statement Saturday at one of two morning town hall meetings at a community center here. “I investigated the Obama administration. I also investigated the Bush administration.”

Issa, 63, has been distancing himself from Trump for some time. Widely seen as a partisan flamethrower during his years leading the House Committee on Oversight and Government Reform and its many investigations of the Obama administration, Issa is more likely these days to defend the budget of the Environmental Protection Agency or to demand a rigorous investigation into allegations of Russian intervention in the 2016 election.

He has good reason to moderate: California’s 49th Congressional District, which encompasses the increasingly diverse and liberal suburban cities in northern San Diego County and southern Orange County, is no longer the safely Republican terrain that it was for Issa’s first eight elections to Congress.

Tim O'Healy, 70, a military veteran from Carlsbad, Calif., speaks in support of veterans’ health benefits during a town hall meeting with Rep. Darrell Issa (R-Calif.) in Oceanside on March 11, 2017. (Hayne Palmour IV/AP)

Last year, Issa won narrowly against a lawyer and retired Marine colonel, Douglas Applegate, who has announced plans to challenge him again in 2018. Last week, environmental lawyer Mike Levin, another Democrat, announced that he, too, plans to challenge Issa.

On Saturday, one questioner noted that some Democrats have wondered whether Trump is too emotionally unstable to be trusted with nuclear weapons.

Issa’s answer stopped short of a full-throated show of support for the new commander in chief. If the issue comes up in front of the appropriate body, he said, “I will vote my conscience.”

Yet Issa’s attempts to distance himself from Trump were met with derision and boos. When he referred to Russian President Vladi­mir Putin as an “evil son of a blank” who sows chaos and then capitalizes on it, an audience member yelled “so does Trump.” The crowd cheered.

A protester outside the community center held a sign that seemed to sum up the attitude of many, if not most, of the more than 1,000 who attended the two sessions: “Repeal and Replace the President.”

One man wore a Russian military hat. Another wore a T-shirt that read, “Trump-Putin, ’16.” A woman held a sign: “Russia-Gate Follow the Money.” Another had a shirt signaling that she is a “nasty woman,” a jibe Trump aimed at Hillary Clinton during a presidential campaign debate.

Between the two sessions, a reporter asked Issa whether he is worried about the 2018 congressional election becoming a referendum on Trump.

(Bastien Inzaurralde/The Washington Post)

“I don’t care,” he said. “Fact is that I’m going to be with Trump sometimes, against him sometimes.”

Only a few of Issa’s colleagues held town hall meetings after Congress’s workweek ended, but questions about the American Health Care Act, as the House GOP plan to replace the Affordable Care Act is known, were rampant. Rep. Douglas A. Collins (R-Ga.), a supporter of the bill, was confronted in a Friday night tele-town hall by a man named Bill who demanded that Republicans pass the repeal package of 2015. That has been the plan favored by Sen. Rand Paul (R-Ky.) and most of the conservative House Freedom Caucus.

“It’s already done,” said the constituent. “It doesn’t take a PowerPoint presentation. Let’s send it up.” Collins assured the constituent that “the 2015 bill is in this package that’s going to be sent to the president,” which is not true, as the AHCA keeps some parts of the ACA that Republicans formerly voted to repeal.

Rep. Ron DeSantis (R-Fla.), a Freedom Caucus member whose district backed Trump by 17 points, told a morning crowd in St. Augustine that he wasn’t ready to back the bill.

“I don’t think you can come to grips with the bill in 36 hours. I don’t,” DeSantis said. “I’m not sure it does enough to lower the costs of health care.”

DeSantis was booed when he praised the idea of expanding health savings accounts, a part of the GOP’s plans; he also said that a viral moment from a CNN interview he did, where he appeared to be saying that cancer patients could get coverage at emergency rooms, was misinterpreted. He was received more sympathetically when he criticized the bill, saying that as structured, it might lead to higher premiums.

“If you do it right, people are going to have access to cheaper plans,” DeSantis said. “If you don’t, I’m not sure it’s going to reduce costs.”

Issa faced questions about the Affordable Care Act, too. He did not fully buy into the current GOP plan being promoted by House Speaker Paul D. Ryan (R-Wis.). But he didn’t help himself with many in the crowd when he referred to the ACA as “Obamacare,” which prompted the audience to boo and cry out, “the Affordable Care Act.”

Issa responded sharply, “Hey, it’s not affordable.”

As at so many other town halls across the country in recent weeks, no one asked Issa about local issues, not even about a recent deployment of Marines from nearby Camp Pendleton to Syria. The only local issue was brought up by Issa: removal of nuclear fuel from the San Onofre power plant.

That suggests that the electorate is primed to turn the 2018 election into a referendum on Trump — something of which Democrats are likely to try to take advantage.

After last year’s squeaker election in the 49th District, Democrats listed Issa as among the most vulnerable Republican incumbents in 2018. The Democratic Congressional Campaign Committee has hired a full-time organizer in the district. In response, the GOP campaign committee has included Issa among 10 House incumbents who will receive additional help from the party.

While most of the crowd Saturday was markedly anti-Trump, a smattering of the president’s supporters were present, some wearing the red “Make America Great Again” campaign hats. A bare-chested man outside held a sign asking “What’s Not To Like?” about Trump’s views.

Repeatedly, Issa asked questioners to be succinct — and implored the rest of the audience to not drown out the question or answer. His goal for the meeting was modest, he joked with the crowd.

“The only thing I ask is that it not end like [the play] ‘Hamilton,’” he said, referring to Alexander Hamilton’s untimely death in a duel with Aaron Burr.

David Weigel in Fort Lauderdale, Fla., contributed to this report.