WASHINGTON — It started as a resolution condemning anti-Semitism. Then, anti-Muslim bias was added in. After that came white supremacy. And by the end, it cited “African-Americans, Native Americans, and other people of color, Jews, Muslims, Hindus, Sikhs, immigrants and others” victimized by bigotry.

The resolution condemning “hateful expressions of intolerance,” which passed the House by an overwhelming 407-to-23 vote Thursday afternoon, was as much a statement of Democrats’ values as their factionalism. Caught in the middle was Speaker Nancy Pelosi, who worked for days to quell the internal uproar that erupted after a freshman Democrat, Representative Ilhan Omar of Minnesota, insinuated that backers of Israel exhibit dual loyalty.

“I see everything as an opportunity,” Ms. Pelosi told reporters Thursday morning as she announced the vote. “This is an opportunity once again to declare as strongly as possible opposition to anti-Semitism, anti-Muslim statements” and “white supremacist attitudes.”

The carefully crafted measure — one Democratic aide called it a “kitchen-sink resolution” — capped an emotional week for Democrats, who found themselves divided along racial and religious lines as they debated how to respond to Ms. Omar.