COSTA MESA, California — Republican Rep. Dana Rohrabacher says religious people should be able to refuse to sell their homes to someone who is gay.

He calls his state's so-called sanctuary law, designed to protect non-criminal undocumented immigrants, "insanity … one more step down the road to oblivion."

And, as for his unusually warm relationship with Russia, Rohrabacher insists any criticism is "baloney" driven by political opponents.

The 70-year-old lawmaker has always been an iconoclast, whose combination of hard-right views, surfer sensibility and longtime support for legal marijuana have proved a good fit for his sun-baked Orange County turf.

Rohrabacher's district, the 48th, is one of seven in California being targeted by Democrats in their quest to reclaim the House. They see a particular opportunity in Orange County, after Hillary Clinton narrowly won it in 2016 over Donald Trump. Tuesday's primary will offer the first test of whether Democrats can pick up seats in that longtime conservative bastion.

After 30 years in Congress, Rohrabacher is facing his toughest re-election battle — a combination of the district's changing demographics, an explosion of progressive activism both locally and nationally, knocks on Rohrabacher's competence and growing questions about his embrace of Moscow.

"Russia is like the preface to a horrible book, and everyone is now reading the book," Hans Keirstead, a stem cell researcher and one of Rohrabacher's Democratic challengers, told NBC News. "It is motivating the constituents of the district to look at what Rohrabacher has done and what he has not done for them over the years."

Rep. Dana Rohrabacher stands under surfboards he used on his honeymoon as he gives a tour of his office in the Rayburn Building in 2011. Tom Williams / CQ-Roll Call / Getty Images

Democrat Harley Rouda, a businessman also challenging Rohrabacher, put it this way: "When you ask voters, 'What is Rohrabacher's detailed relationship with Russia doing to help create jobs here, helping your schools, helping your communities?' Regardless of where they are on the political spectrum they will certainly look up and say, 'You're right. What is he doing?'"

In an extensive interview with NBC News outside his home here, Rohrabacher insisted his constituents don't care much about his relationship with Moscow. Those who do, he said, tell him "it's good a good thing I am looking out for this country internationally."

Two other Republicans whose districts touch Orange County — Reps. Darrell Issa and Ed Royce — have opted to retire this year, leaving Rohrabacher as the state's most imperiled GOP incumbent.

While Rouda and Keirsted lead a large field of Democrats vying to knock him off, Rohrabacher also faces a robust challenge from a one-time GOP protégé, former Assemblyman Scott Baugh. The two erstwhile allies have been locked in a bitter battle, with Rohrabacher dismissing Baugh as a cash-driven lobbyist and Baugh depicting Rohrabacher as both absent and inconsequential.

"The good news for me is there's a bipartisan consensus that 30 years is too long, especially if you're not effective," Baugh told NBC News.

By dint of California's so-called "jungle" primary system, all candidates run on the same ballot regardless of party, with the top two vote-getters advancing to the general election. That means that in statewide races or districts across California, two Republicans could move on to face one another in November, or two Democrats.

In his district, Rohrabacher is expected to prevail in the crowded field on Tuesday, with Baugh, Rouda or Keirstead vying for second.

Democratic strategists are terrified that their glut of candidates in the district slice up the vote and push Baugh into the number two spot. The Democratic Congressional Campaign Committee has run a seven-figure TV advertising buy against the Republican, hoping to knock him out of contention.

Rohrabacher's flirtation with Russia has been well documented over the years, but is receiving additional scrutiny now amid special counsel Robert Mueller's probe of the Trump 2016 campaign's potential ties to Moscow.

Rohrabacher's name emerged in February, when former Trump campaign aide Rick Gates pleaded guilty to lying about a meeting between former Trump campaign chair Paul Manafort and a lobbyist for Ukraine. Rohrabacher also attended the meeting.

House Majority Leader Kevin McCarthy, a Republican colleague of Rohrabacher's, was recorded in 2016 saying he believed Rohrabacher and Trump could be on Russian President Valdimir Putin's payroll. McCarthy later called the comment "an attempt at humor gone wrong."

Rohrabacher also met last August with Julian Assange, the founder of WikiLeaks, and has defended WikiLeaks against allegations the group disseminated Russia-hacked emails from the Democratic National Committee and Clinton campaign chairman John Podesta.

NBC News has previously reported that Mueller's investigators are interested in a meeting between Rohrabacher and Mike Flynn, Trump's former national security adviser who has pleaded guilty to lying to the FBI and is now cooperating with Mueller's Russia probe.

Rohrabacher acknowledged meeting with Flynn, whom he calls "an American patriot," but said it was about nuclear power plants, not Russia.

Rohrabacher told NBC News he has met with both the House and Senate Intelligence committees as part of their investigations into Russia, but said he has not been contacted by Mueller's team. He dismissed the probe — and questions about his relationship to Russia — as a politically motivated stunt.

"The Democrats are so committed to creating a fraudulent image in order to steal this election, not just from me but from Republicans in general, that they will make things that sound sinister which are everyday business," Rohrabacher said.

By "everyday business," Rohrabacher points to his responsibilities as chairman of a House Foreign Affairs subcommittee overseeing Russia.

"I am an advocate for cooperation with Russia in trying to defeat radical Islamic terrorism, terrorists who actually kill Russians, terrorists who kill Americans. It makes all the sense in the world for us to cooperate with the Russians to defeat radical Islamic terrorism," Rohrabacher said.

For now, he is leaning hard into issues that could motivate Republican voters in the primary and beyond.

He has focused on California's sanctuary law, which was designed to limit the involvement of local police in federal immigration enforcement. The law provoked a backlash across Orange County, with many communities there joining a Trump administration lawsuit against the measure.

The president himself has spoken out repeatedly against the state's sanctuary protections.

There is a Revolution going on in California. Soooo many Sanctuary areas want OUT of this ridiculous, crime infested & breeding concept. Jerry Brown is trying to back out of the National Guard at the Border, but the people of the State are not happy. Want Security & Safety NOW! — Donald J. Trump (@realDonaldTrump) April 18, 2018

"There is a Revolution going on in California. Soooo many Sanctuary areas want OUT of this ridiculous, crime infested & breeding concept," Trump tweeted in April.

Just 37 percent of Orange County residents approve of Trump's job performance, according to an April Chapman University poll. But Republicans say their private polling has shown a spike in the president's popularity in the county in recent weeks, which they attribute to the strengthening economy.

Rohrabacher has attended numerous city council meetings where the sanctuary issue has been debated, often in heated tones. He's gone so far as to offer to pay for one city's effort to join the federal lawsuit.

"My constituents say they are grateful that someone is finally standing up for them," Rohrabacher said, adding that the sanctuary law is "preventing our own law enforcement from cooperating with the federal government to get control of criminal illegal immigrants."

The law, in fact, does not protect anyone charged with a serious crime.

Rohrabacher has also sparked controversy recently over his contention that those with strongly held religious views should not be forced to sell their homes to gay people — a form of discrimination specifically outlawed in California housing law.

The comment cost him the endorsement of the National Association of Realtors, but Rohrabacher remains unapologetic.

"I should be doing what I think is right. What is not right is to force someone who is religious, who has religious convictions against certain lifestyles, to have to do business and sell his or her home to people who are engaged in a lifestyle they think is immoral," Rohrabacher told NBC News.

Rohrabacher said he is largely looking past next week's primary and focusing on the November general election, where he hopes to squash the notion that Democrats are poised for big gains in the House.

"There's going to be no blue wave, I will tell you right now," Rohrabacher said. "I'm a surfer, I can tell you when there is a wave to ride, and the wave is going in the other direction in this election."