A little 4-year-old boy jumped out of a car on Sunday after a man carjacked his mother's vehicle, the Associated Press reports.

The boy escaped with a few cuts and bruises but was not severely hurt.

"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."

Reports say the boy was waiting for his mother in the car when a man jumped in the vehicle and took off. Although a suspect has not been identified, investigators do not believe that the man intended to kidnap the little boy.

The boy's mother was apparently visiting family members at the time of the carjack. When she buckled him into the car, she went back inside the house to say goodbye. Then, the man jumped into the car and fled while the four-year-old boy jumped out at the end of the block.

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

Less than a month ago, a suspect carjacked a vehicle in California that was running in front of a home where a little boy was sleeping in the backseat. The 8-year-old boy was found still sleeping after officials discovered the car just two miles from the home.

Officer Silvia urges people to not leave their cars running and unattended, especially with children inside.

The investigation is ongoing, and there is no further information on the carjacking.

It is not clear how the suspect would be charged when he is caught. Carjacking is a felony in California, according to LA Criminal Defense Partners.

Defendants charged with carjacking can be sent to prison for up to nine years. They could also be put on probation and given a fine of up to $10,000.