WASHINGTON—The Supreme Court struck down the harshest parts of an Arizona law targeting illegal immigrants, ruling the state interfered with congressional authority over U.S. borders, but it let stand a requirement that police check the immigration status of people they stop for traffic or other offenses.

By a vote of 6-2, the court voided a provision making it a state crime for an immigrant to fail to carry federal registration papers. By 5-3 votes, it invalidated sections that authorized jail time for illegal immigrants...