WASHINGTON — President Trump lashed out at undocumented immigrants during a White House meeting on Wednesday, warning in front of news cameras that dangerous people were clamoring to breach the country’s borders and branding such people “animals.”

Mr. Trump’s comments came during a round-table discussion with state and local leaders on California’s so-called sanctuary laws, which strictly limit communication between local law enforcement and federal immigration officers, and which the Trump administration is suing to invalidate. It was hardly the first time the president has spoken in racially fraught terms about immigrants, but it underscored his anger about unchecked immigration — the animating issue of his campaign and his tenure so far — and his frustration that he has not been able to do more to seal the nation’s borders.

As he has in numerous private meetings with his advisers at the White House, Mr. Trump used the session to vent about the nation’s immigration laws, calling them “the dumbest laws on immigration in the world.” He exhorted his administration to “do much better” in keeping out undesirable people, including members of transnational gangs like MS-13.

“We have people coming into the country, or trying to come in — we’re stopping a lot of them,” Mr. Trump said in the Cabinet Room during an hourlong meeting that reporters were allowed to document. “You wouldn’t believe how bad these people are. These aren’t people, these are animals, and we’re taking them out of the country at a level and at a rate that’s never happened before.”