Science teacher John Butler along with his wife Kim, their two children, Greg and Katie, who always go bare feet, and their dog, Digger, are on a rafting trip on the Amazon River. As they are going down the river, their boat hits a rock and capsizes. The family then gets caught in a whirlpool. When they surface upon going through an underground cavern, they find themselves in a prehistoric valley where they meet caveman Gorok, his wife Gara, their two children Lok and Tana, and their pet, a baby Stegosaurus named Glump. The two families become friends. Gorok and his family help the Butlers in their attempts to find a way to return home, while the Butlers help them in their daily lives by, for example, introducing them to basic technology, such as simple machines (the lever and the wheel), sailboats and windmills.