California’s top House Republican offered a measured defense Monday of President Trump’s racist attacks on four House members who are women of color, while most of the state’s GOP establishment stayed silent.

Minority Leader Kevin McCarthy of Bakersfield told reporters in Washington late Monday that the president was trying to make a point about Democrats’ attraction to “socialism” when he tweeted Sunday that the congresswomen “originally came from countries whose governments are a complete and total catastrophe” and that they should “go back and help fix the totally broken and crime infested places from which they came.”

McCarthy pointed to a follow-up tweet from Trump on Monday in which the president said Democrats were “endorsing Socialism” by denouncing his attack on the House members.

The Dems were trying to distance themselves from the four “progressives,” but now they are forced to embrace them. That means they are endorsing Socialism, hate of Israel and the USA! Not good for the Democrats! — Donald J. Trump (@realDonaldTrump) July 15, 2019

Trump did not name them, but his targets were clearly Democratic Reps. Ayanna Pressley of Massachusetts, Rashida Tlaib of Michigan and Alexandria Ocasio-Cortez of New York — all of whom were born in the U.S. — and Ilhan Omar of Minnesota, whose family came here from Somalia to escape that nation’s civil war when she was 10.

McCarthy pointed out that some of the lawmakers recently questioned House Speaker Nancy Pelosi’s actions, and that Ocasio-Cortez had accused the San Francisco Democrat of “explicit singling out of newly elected women of color” in telling House Democrats not to go public with party infighting.

But pressed on whether he thought Omar, for example, should go back to Somalia, McCarthy rejected the suggestion.

“No, they’re Americans. Nobody believes somebody should leave the country,” McCarthy said. “They have a right to give their opinion. It’s a debate about ideology. ... We’re the only country created that’s conceived in liberty and dedicated to the proposition that everybody is equal, and that’s fundamentally, that’s what I believe in.”

McCarthy also grew combative with a reporter who asked why he had not responded sooner to the president’s comments or tweeted his thoughts the day before.

“Did you ask me a question yesterday?” McCarthy said. “Really, how often did I tweet? ... Now you’re going to judge whether I do or do not something? I think that’s very unfair.”

None of California’s six other House Republicans publicly criticized Trump. Also silent was California Republican Party chair Jessica Millan Patterson, the first woman and first Latina to lead the 140-year-old organization, whose paternal grandfather was born in Mexico. She did not respond to a request for comment Monday.

When Patterson won the chair’s race in February, she stressed that her top priority was broadening the party’s appeal beyond its base of white voters.

“We need to get back into communities. We need to start engaging people. People are not going to re-register as Republican as long as they think that we are one thing,” Patterson said at the state GOP convention. “We need to make them feel comfortable and welcomed into our party. It’s going to be the solution for a lot of our issues.”

Republican Assemblyman Chad Mayes of Yucca Valley (San Bernardino County) was virtually alone in denouncing Trump’s remarks, tweeting Sunday that what the president said was “beyond unacceptable, it is wrong and abhorrent.”

This is beyond unacceptable, it is wrong and abhorrent. Dear Fellow Republicans, we must speak out and return ourselves to decency. This cannot be who we are! https://t.co/iAQM9A0wFp — Chad Mayes (@ChadMayes) July 14, 2019

The California Assembly Republicans’ Twitter account ignored Trump’s comments, but did tweet Monday that heat stroke “can be life threatening to our furry friends.”

Nearly all Republican officeholders nationally initially avoided commenting on Trump’s tweets, but a few ventured criticism of the president Monday as lawmakers returned to the Capitol.

Rep. Will Hurd of Texas, the only African American Republican in the House, was one of the few Republicans to call Trump’s comments “racist and xenophobic.” He said Trump’s remarks would make it more difficult for the president to win over new GOP voters.

The only black GOP senator, Sen. Tim Scott of South Carolina, said that “instead of sharing how the Democratic Party’s far-left, pro-socialist policies ... are wrong for the future of our nation, the president interjected with unacceptable personal attacks and racially offensive language. No matter our political disagreements, aiming for the lowest common denominator will only divide our nation further.”

Senate Majority Leader Mitch McConnell of Kentucky declined to address Trump’s remarks, saying he would discuss them at his regularly scheduled Tuesday news conference.

At least one Republican strategist in California said Trump’s remarks wouldn’t necessarily damage him politically.

“Trump is always willing to punch down when he’s being attacked,” said John Thomas, who runs Thomas Partners Strategies. “Omar and AOC (Ocasio-Cortez) continually personally attack Trump and undermine his policy agenda by mischaracterizing the crisis at the border.

“Picking a fight with AOC and Omar is smart politics for a general election, as it begins to brand them as the face of the Democratic Party,” Thomas said in an email. “Recent surveys show that both of those congresswomen are toxic with swing voters Dems must hold if they want to carry the House and win the presidency.”

But Dave Jacobson, a Democratic strategist in Los Angeles, said Trump’s comments will “absolutely” become an issue with socially moderate, fiscally conservative Republican women in swing districts such as four in Orange County that Democratic House candidates flipped last year.

“A lot of traditional, John McCain-supporting women believe in Republicanism but they’re not racists,” said Jacobson, who who worked on House races in the Central Valley, Orange County and nationally in 2018. “It would be political malpractice if you didn’t force Republicans, especially in swing districts, to come out and publicly criticize” Trump for his comments.

Joe Garofoli is The San Francisco Chronicle’s senior political writer. Email: jgarofoli@sfchronicle.com Twitter: @joegarofoli

Tal Kopan is The San Francisco Chronicle’s Washington correspondent. Email: tal.kopan@sfchronicle.com. Twitter: @TalKopan