WASHINGTON — Dozens of Iranians and Iranian-Americans were held for hours at Washington State’s border with Canada over the weekend as the Department of Homeland Security ramped up security at border ports after Iran threatened to retaliate against the United States for the strike that killed its top military leader.

More than 60 of the travelers, many returning from work trips or vacations, were trying to come home to the United States on Saturday when agents at the Peace Arch Border Crossing in Blaine, Wash., held them for additional questioning about their political views and allegiances, according to advocacy groups and accounts from travelers.

Most of the travelers were released after the extra scrutiny, according to administration officials, although advocates said some were denied entry into the United States.

Masih Fouladi, an executive director of the Council on American-Islamic Relations, a Muslim civil rights and advocacy organization, said some were held in a waiting room and questioned for up to 10 hours. Later on Saturday night, when others who had just attended a concert in Canada by an Iranian pop star were trying to cross back into the United States, they were denied entry and told to come back later, Mr. Fouladi said.