Thousands of Yemeni-Americans and their supporters rallied in Brooklyn on Thursday to denounce President Trump’s executive order on immigration, hours after hundreds of Yemeni-owned bodegas and grocery stores around New York closed to protest the order.

Waving American and Yemeni flags and holding signs in English and Arabic, the demonstrators filled the plaza at Borough Hall. They gathered for the Islamic sunset prayer and listened intently as a series of public officials greeted them with the words “Assalamu alaikum” and condemned the president’s order, which temporarily bars citizens of Yemen and six other majority-Muslim countries from entering the United States.

“This order goes against everything we came here for and everything America stands for,” said Abdul Salam Mubaraz, a bodega owner who had closed his shop for the day and spoke from the stage. For people fleeing war-torn countries like Yemen, he said, the restrictions amounted to “having the door of freedom shut by President Trump.”

Yemeni-owned bodegas are institutions in many New York neighborhoods, selling coffee and bagels, groceries, umbrellas and many other items. Organizers said several hundred had closed from noon to 8 p.m. on Thursday in protest, which Eric L. Adams, the Brooklyn borough president, told the crowd, sent “a loud and clear message to America.”