Although there has been a growing literature on cooperative diversity, the current literature is mainly limited to the Rayleigh fading channel model, which typically assumes a wireless communication scenario with a stationary base station antenna above rooftop level and a mobile station at street level. In this paper, we investigate cooperative diversity for intervehicular communication based on cascaded Nakagami fading. This channel model provides a realistic description of an intervehicular channel where two or more independent Nakagami fading processes are assumed to be generated by independent groups of scatterers around the two mobile terminals. We investigate the performance of amplify-and-forward relaying for an intervehicular cooperative scheme assisted by either a roadside access point or another vehicle that acts as a relay. Our diversity analysis reveals that the cooperative scheme is able to extract the full distributed spatial diversity. We further formulate a power-allocation problem for the considered scheme to optimize the power allocated to the broadcasting and relaying phases. Performance gains up to 3 dB are obtained through optimum power allocation, depending on the relay location.