LANCASTER, N.C. — A 3-year-old boy died Sunday, four days after he was trapped in his family's car on the hottest day of the year.

Logan Cox, who had been missing for less than an hour before he was found in a parked car in front of the family's home Wednesday, died of heatstroke, according to Carolinas Medical Center.

"I know it was an accident," Logan's grandfather, Jimmy Clevinger, said. "My daughter was laying on the couch with him watching TV and my wife was in the bedroom."

Investigators with the Lancaster County Sheriff's Office say Logan left the home without his mother knowing it, got into the car with the family's dog and somehow got trapped inside. The dog also succumbed to the heat, Clevenger said.

Investigators say the toddler was missing for between 30 minutes to an hour before his mother found him in the car.

"He knows how to unlock these cars 'cause he'll sit and play; he's watched when they hit the button for the locks. He had got out of the house, got in the car, it was so hot in there and it overtook him."

Last week, Clevinger said Logan hadn't been in the hot car for long when the family found him.

"Anywhere from 15, 15 to 20 minutes, if that," Clevinger said.

Logan was airlifted to the hospital after he was taken out of the car. Family members said Friday he was expected to be released Monday.

So far this year, at least 13 children have died from heat stroke after being left in vehicles or climbing in and getting trapped, according to KidsAndCars.org, a nonprofit child-safety organization that monitors news sites and police reports involving children and vehicle accidents. Last year 44 children died.

The Lancaster County Sheriff's Office had no comment Sunday night. The sheriff's department and social services are still investigating.