The unconventional transport and magnetic properties of perovskitelike lanthanum cobalt oxide LaCoO3 have been studied for more than five decades. This highly correlated electron system exhibits a variety of peculiar properties that are desirable for environmentally friendly energy solutions, fuel cell technologies, novel diesel engines, and oxyfuel power plants. However, the true spin state of the Co3+ ion is an important but still unresolved issue that underlies these applications. Although many theoretical models have been proposed, finding supporting experimental evidence of spin-state transitions is extremely difficult. Not until recently have new advanced scattering methods emerged allowing unprecedented precision in determining the crystal structure of LaCoO3. In this work, we combine high-resolution extended x-ray absorption fine structure, x-ray powder diffraction, and neutron powder and single-crystal diffraction over a broad range of temperatures, from 2 up to 1000 K, as well as quantum mechanical modeling to study the spin-state transition in LaCoO3 and in a reference sample of LaGaO3. Our results suggest that the Co ions are mainly in a low-spin state at temperatures below 150 K, with a minority of ions in a high-spin state. With an increase in the temperature the gradual transition from low- to intermediate-spin state occurs up until 550 K. At the metal-insulator transition at 550 K, the long-range domains of the intermediate-spin states become a dominant contribution. Above 550 K, a transition from intermediate- to high-spin state is observed. It is established that a slight change in the degree of pd hybridization can lead to the appearance of a spin-state transition which might be induced by both temperature and surface effects in powder crystallites.