The decision dealt a setback to President Donald Trump and the Republican Party's odds of maintaining its slim majority in the U.S. House.