Police say it started with a wrong turn that prompted a driver to step out of his car.

He shut the door.

That’s when the man’s dog, Max, hit the gearshift and put the car into reverse, according to authorities in Port St. Lucie, Fla. Thus began about half an hour of mayhem Thursday morning as Max took the car round and round a cul-de-sac, exiting only after police responded to the scene.

Authorities described Max’s gear shift as accidental, and The Washington Post was unable to reach the large black dog to vet his intentions.

Locked out, the unidentified owner gave police an extra fob — only to be thwarted by a dead battery, police said. Officers eventually got in by entering a code into the key pad on the driver’s-side door.

Local media reported that the episode left tread marks on the road.

Anna Sabol, who lives across from the cul-de-sac, told the Sun-Sentinel she started watching the car’s strange doughnuts after her own dogs began to bark. She looked out her window to see officers gathered around.

It took her a while to realize that a canine was behind the wheel, she said.

“First I thought I saw somebody backing up, but then they kept going and I’m like, ‘Okay, what are they doing?’ ” she recounted to local news station WPBF-TV.

Her reaction when a dog got out of the vehicle: “This is turning weird.”

Sabol told the Sun-Sentinel that the car finally stopped after going up a lawn and hitting a mailbox. The dog’s owner has reportedly promised to fix the damage.

No one was hurt, and the silver 2003 Mercury Sable sustained only minor damage, the Port St. Lucie Police Department said. It described Max in a statement as “fine, healthy and happy.”

“They should give that dog a license,” Sabol told the Sun-Sentinel. “He drives better than some people I’ve seen on the roads here.”

Read more: