For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

The Supreme Court on Monday agreed to review President Donald Trump’s executive order barring travelers from six Muslim-majority countries, as well as all new refugees, from entering the United States. The court also allowed the ban to go into effect while it considers the case, except in the case of visitors with a “bona fide relationship” with people or entities in the United States.

Earlier this year, two federal appeals courts blocked Trump’s order. The Supreme Court will hear the case in October and decide the permanent fate of the full ban.

Opponents of the travel ban have said the order is a form of religious discrimination that violates the First Amendment. The Trump administration has argued that the president has the authority to write new policies concerning immigration in the interest of national security.

Three of the court’s conservative justices—Clarence Thomas, Samuel Alito, and the newest justice, Neil Gorsuch—wrote that they would have allowed the full ban to go into effect while the case is being decided. Chief Justice John Roberts sided with the court’s liberals and swing Justice Anthony Kennedy in keeping part of the ban on hold.

“Today’s unanimous Supreme Court decision is a clear victory for our national security,” Trump said in a statement. “It allows the travel suspension for the six terror-prone countries and the refugee suspension to become largely effective.”

“As President, I cannot allow people into our country who want to do us harm. I want people who can love the United States and all of its citizens, and who will be hardworking and productive.”