A frightened 4-year-old boy escaped with cuts and scrapes after he got out of his car seat and jumped from a moving car during a carjacking, police said Monday.

The boy was waiting for his mother on Sunday inside the running car when a man got in and fled. The boy jumped out at the end of the block.

"He was very scared," Stockton police Officer Joe Silva said. "He didn't know what this man was going to do to him. We could have had a tragic ending."

Silva said investigators do not believe the man intended to kidnap the boy. A suspect has not been identified or arrested.

The boy and his mother were visiting relatives. The mom had put him in a car seat and gone back inside to say goodbye when the man struck, Silva said.

He did not know how fast the man was going when the boy jumped out.

The carjacking follows a similar incident in California less than a month ago, when someone took a car that was running in front of a home with an 8-year-old boy sleeping inside.

The boy was found uninjured inside the car several hours later about 2 miles away.

Silva said drivers should never leave cars unattended and running, especially with children inside.

"What a lot of car thieves do is go into neighborhoods looking for cars that are left unattended and running," he said. "It's a crime of opportunity for them."