The U.S. Supreme Court ruled Wednesday that police cannot always enter a home without a warrant when pursuing someone for a minor crime.

The court sent the case back to the lower court to decide if the police violated the rights of a California man by pursuing him into his garage for allegedly playing loud music while driving down a deserted two-lane highway late at night."

Writing for the unanimous court, Justice Elena Kagan said police had no right to enter the man's home without a warrant for such a trivial offense, NPR reports.

"On many occasions, the officer will have good reason to enter – to prevent imminent harms of violence, destruction of evidence, or escape from the home," she wrote. "But when the officer has time to get a warrant, he must do so – even though the misdemeanant fled."

The Supreme Court has long held that police may conduct a warrantless search when pursuing a fleeing felon. The question in Lange's case was whether police are free to do the same thing when pursuing someone suspected of a minor offense.

"[P]ursuit of a misdemeanant does not trigger a categorical rule allowing a warrantless home entry," Kagan wrote.