An algorithm for the simultaneous estimation of the orientation and shape of the stress tensor and the individual fault plane solutions for a population of earthquakes is studied. It corresponds to a synthesis of the methods used by Brillinger et al. (1980) to obtain focal mechanisms and by Armijo and Cisternas (1978) for stress tensor analysis in microtectonics. The input data are the polarities of the P arrival and take-off angles for the set of source-station pairs. The method distinguishes, in general, which one of the nodal planes corresponds to the fault and gives the direction of the slip. The application to the aftershock sequence of the 1980 Arudy earthquake (Western Pyrenees) shows that the observations may be explained by a single stress tensor producing a N32°E extension, with a likelihood of 95 per cent.