Former president Barack Obama said he's "heartened" by American civic engagement, following a weekend of spontaneous protests in the wake of President Donald Trump's executive order related to immigration from seven Muslim-majority countries.

"Citizens exercising their Constitutional right to assemble, organize and have their voices heard by their elected officials is exactly what we expect to see when American values are at stake," Obama spokesman Kevin Lewis said Monday in a written statement.

Lewis referenced Obama's farewell address, in which the outgoing president called on Americans to get involved to demand change. It's not just that every person is created equal and endowed with certain unalienable rights, but, Obama said, "it's the insistence that these rights, while self-evident, have never been self-executing; that we, the people, through the instrument of our democracy can form a more perfect union."

Over the weekend, demonstrators rallied against Trump's order, which imposed travel restrictions on foreign citizens from Iraq, Syria, Sudan, Iran, Somalia, Libya and Yemen. Crowds outside of airports shouted, "Let them in!" and cheered when detainees were released.

A federal judge subsequently granted an emergency stay, barring the deportation of people with valid visas who landed in the U.S. amid the uncertainty and chaos of Trump's order. The American Civil Liberties Union and other activist groups filed a class action lawsuit on Saturday, seeking to challenge the president's order, as acrimony widened over the policy and the number of detainees waylaid in transit appeared to swell.