The crash happened around 10 am on State Route 165 near River Road, located between Stevinson and Hilmar.
The California Highway Patrol said the truck driver was northbound on Highway 165. When he approached a curve, he failed to turn and veered off the road.
The truck flipped onto its roof, pinning in the driver. Firefighters had to use Jaws of Life equipment to extricate him from the vehicle.
CHP officers say the driver was lucky to walk away with minor injuries.
Officials said there was recently a fatal crash near that stretch of highway. Officers are reminding drivers to be vigilant while traveling in the area.