data. The same data deviate markedly from the theoretical results computed using the PFA. This clearly demonstrates the influence of diffraction effects on the lateral Casimir force. Some of the results of this paper related to the first set of our measurements were briefly published in Ref. [41]. Here, we present additional phase dependences of the lateral Casimir force not included in Ref. [41] for the same corrugation amplitudes, as were used in [41], and also the results of further experiments performed with a much larger corrugation amplitude on the sphere. We demonstrate that the experimental data of various measurements for different samples are in mutual agreement. We also present additional important evidence characterizing the quality of corrugated surfaces, procedures of electrostatic calibrations, and details of error analysis. Calculations using the PFA are done by means of the exact Lifshitz formula rather than with the help of perturbation theory in corrugation amplitudes, as in Ref. [41]. The role of surface roughness is estimated. The details of exact computations of the lateral Casimir force using the Rayleigh scattering theory at nonzero temperature given in this paper have never been presented previously. The paper is organized as follows. In Sec. II we describe the experimental setup and sample preparation. Section III contains the description of the procedures of electrostatic calibration using both the normal and lateral electric forces. In Sec. IV the measurement data and the error analysis are presented. Section V is devoted to the computation of the lateral Casimir force between corrugated surfaces using the PFA. In Sec. VI the lateral Casimir force is computed in a more fundamental way using the Rayleigh theory. In both Secs. V and VI the theoretical results are compared with the experimental data. Section VII contains our conclusions and discussion. A schematic diagram of the experimental setup is shown in Fig. 1. The experiments under discussion are performed using a standard atomic force microscope (AFM) in oil-free vacuum chamber at a pressure below 10 mTorr and at room temperature. The observation of the lateral Casimir force is done using two test bodies whose surfaces are covered with longitudinal sinusoidal corrugations of the same period. The axes of the corrugations should be perfectly parallel. Following [38], one can see that misalignment by 1 ◦ of the axes of corrugations can lead to the loss of any lateral force. As the first test body, we have used 6 II. EXPERIMENTAL SETUP AND SAMPLE PREPARATION