WASHINGTON  The Supreme Court ruled Wednesday that evidence obtained from an unlawful arrest based on careless record keeping by the police may be used against a criminal defendant.

The 5-to-4 decision revealed competing conceptions of the exclusionary rule, which requires the suppression of some evidence obtained through police misconduct, and suggested that the court’s commitment to the rule was fragile.

Chief Justice John G. Roberts Jr., writing for the majority, said that the exclusion of evidence should be a last resort and that judges should use a sliding scale in deciding whether particular misconduct by the police warranted suppressing the evidence they had found.

“To trigger the exclusionary rule,” Chief Justice Roberts wrote, “police conduct must be sufficiently deliberate that exclusion can meaningfully deter it, and sufficiently culpable that such deterrence is worth the price paid by the justice system.”