Justice Sonia Sotomayor slammed the Supreme Court's decision to uphold President Donald Trump's travel ban.

She wrote an impassioned dissenting opinion that contended the majority's ruling failed to "safeguard" the principle of religious neutrality embedded in the First Amendment.

Sotomayor contended the majority had ignored Trump's "anti-Muslim" rhetoric.

The Supreme Court justice said a "reasonable observer" would conclude the travel ban was motivated by "anti-Muslim animus."

Justice Sonia Sotomayor slammed the Supreme Court's decision to uphold President Donald Trump's travel ban in an impassioned dissenting opinion that contended the ruling failed to "safeguard" the principle of religious neutrality embedded in the First Amendment.

The Supreme Court on Tuesday voted 5-4 to uphold the controversial travel ban, which primarily targets majority-Muslim countries.

The White House has put forward several versions of the travel ban since Trump took office, facing legal obstacles in the process. The latest is the third iteration and places restrictions on travelers coming to the US from Syria, Iran, Yemen, Somalia, Libya, North Korea, and Venezuela.

12 PHOTOS US Supreme Court Associate Justice Sonia Sotomayor See Gallery US Supreme Court Associate Justice Sonia Sotomayor US Supreme Court Associate Justice Sonia Sotomayor stands for an official photo with other members of the US Supreme Court in the Supreme Court in Washington, DC, June 1, 2017. / AFP PHOTO / SAUL LOEB (Photo credit should read SAUL LOEB/AFP/Getty Images) SAN FRANCISCO, CA - JANUARY 28: US Supreme Court Associate Justice Sonia Sotomayor speaks during a Commonwealth Club event at Herbst Theatre on January 28, 2013 in San Francisco, California. Sotomayor spoke in conversation with Stanford law school dean Mary Elizabeth Magill at the Commonwealth Club as she promotes her new book 'My Beloved World' (Photo by Justin Sullivan/Getty Images) US Attorney General Loretta Lynch and Supreme Court Justice Sonia Sotomayor attendan investiture ceremony for Lynch at the Warner Theatre in Washington, DC, June 17, 2015. AFP PHOTO / SAUL LOEB (Photo credit should read SAUL LOEB/AFP/Getty Images) Supreme Court Justice Sonia Sotomayor speaks during a ribbon cutting ceremony at George Washington University's Jacob Burns Community Legal Clinics January 23, 2014 in Washington, DC. Sotomayor and others attended the ribbon cutting officially opening the Jacob Burns Community Legal Clinics new building. AFP PHOTO/Brendan SMIALOWSKI (Photo credit should read BRENDAN SMIALOWSKI/AFP/Getty Images) Supreme Court Justice Sonia Maria Sotomayor presses the countdown ball as thousands of revelers gather in New York's Times Square to celebrate the ball drop at the annual New Years Eve celebration on December 31, 2013 in New York City. AFP PHOTO / TIMOTHY A. CLARY (Photo credit should read TIMOTHY A. CLARY/AFP/Getty Images) US Vice President takes the oath of office during the 57th Presidential Inauguration ceremonial swearing-in at the US Capitol on January 21, 2013 in Washington, DC. The oath was administered by US Supreme Associate Justice Sonia Sotomayor(R) . AFP PHOTO / Saul LOEB (Photo credit should read SAUL LOEB/AFP/Getty Images) NEW YORK, NY - MAY 16: U.S. Supreme Court Justice Sonia Sotomayor (CENTER R) and TV financial journalist Maria Bartiromo (2nd R) depart New York University's commencement ceremony at Yankee Stadium on May 16, 2012 in the Bronx borough of New York City. Sotomayor spoke to a crowd of more than 27,000 at the ceremony and was raised in a Bronx housing project not far from the stadium. (Photo by Mario Tama/Getty Images) US Supreme Court Justice Sonia Sotomayor listens as President Barack Obama speaks during the Congressional Hispanic Caucus Instituteâs 34th Annual Awards Gala at the Washington Convention Center in Washington, DC, September 14, 2011. AFP PHOTO / Saul LOEB (Photo credit should read SAUL LOEB/AFP/Getty Images) NEW YORK - JUNE 4: U.S. Supreme Court Justice Sonia Sotomayor delivers the keynote address at the Hostos Community College 39th commencement ceremony June 4, 2010 in New York City. Also pictured are college President Felix Matos Rodriguez (L) and Dr. Matthew Goldstein, chancellor of City University of New York. (Photo by Craig Ruttle-Pool/Getty Images) US Supreme Court Associate Justice Sonia Sotomayor participates in the courts official photo session on October 8, 2010 at the Supreme Court in Washington, DC. AFP PHOTO / TIM SLOAN (Photo credit should read TIM SLOAN/AFP/Getty Images) NEW YORK, NY - APRIL 13: Justice Sonia Sotomayor attends The 2018 DVF Awards at United Nations on April 13, 2018 in New York City. (Photo by Dimitrios Kambouris/Getty Images) NEW YORK, NY - AUGUST 31: Sonia Sotomayor, left, Associate Justice of the Supreme Court of the United States, with family and friends in the 'Judge's Chambers' before a game between the Boston Red Sox and New York Yankees at Yankee Stadium on August 31, 2017 in the Bronx borough of New York City. (Photo by Rich Schultz/Getty Images) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

"The United States of America is a Nation built upon the promise of religious liberty," Sotomayor wrote in her opinion. "Our Founders honored that core promise by embedding the principle of religious neutrality in the First Amendment. The Court’s decision today fails to safeguard that fundamental principle."

Sotomayor pointed to Trump's rhetoric, including his call for a "total and complete shutdown of Muslims entering the United States" during the US presidential campaign, as evidence the travel ban is motivated by "anti-Muslim animus."

"A reasonable observer would conclude that the Proclamation was motivated by anti-Muslim animus," Sotomayor wrote. "The majority holds otherwise by ignoring the facts, misconstruing our legal precedent, and turning a blind eye to the pain and suffering the Proclamation inflicts upon countless families and individuals, many of whom are United States citizens."

She accused those who voted to uphold the travel ban of "completely" setting "aside the President’s charged statements about Muslims."

Sotomayor wrote that she was unconvinced the travel ban does not target Muslims simply because it also affects North Korea and Venezuela.

"The President’s inclusion of North Korea and Venezuela does little to mitigate the anti-Muslim animus that permeates the Proclamation," Sotomayor wrote, adding that the travel ban "overwhelmingly targets Muslim-majority nations." In Sotomayor's view, the travel ban "masquerades behind a façade of national-security concerns."

The Supreme Court justice also said there were "stark parallels" between the logic employed by the Supreme Court in upholding the Trump travel ban and the decision in Korematsu v. United States, which upheld the executive order to detain Japanese Americans during World War II.

Chief Justice John Roberts and Justices Anthony Kennedy, Clarence Thomas, Samuel Alito, and Neil Gorsuch voted to uphold the travel ban. Justices Stephen Breyer, Elena Kagan, and Ruth Bader Ginsburg joined Sotomayor in dissenting.

Meanwhile, Trump celebrated the ruling, tweeting, "SUPREME COURT UPHOLDS TRUMP TRAVEL BAN. Wow!"

NOW WATCH: This top economist has a radical plan to change the way Americans vote

See Also:

SEE ALSO: The Supreme Court just upheld Trump's travel ban

DON'T MISS: The Supreme Court just quietly overturned a decision that allowed the US government to place Japanese-Americans in 'concentration camps' during World War II