The magnetocrystalline anisotropy (MCA) of (Ga,Mn)As films has been studied on the basis of ab initio electronic structure theory by performing magnetic torque calculations. An appreciable contribution to the in-plane uniaxial anisotropy can be attributed to an extended region adjacent to the surface. Calculations of the exchange tensor allow to ascribe a significant part to the MCA to the exchange anisotropy, caused either by a tetragonal distortion of the lattice or by the presence of the surface or interface. Diluted magnetic semiconductors (DMSs) are a class of materials having attractive properties for spintronic applications (e.g., see the review in Ref. 1). Many investigations in this field are focused on the (Ga,Mn)As DMS system with 1%-10% of Mn atoms which have promising features from a physical as well as technological point of view. The crucial role of valence states with respect to various magnetic properties of (Ga,Mn)As was discussed in the literature by many authors (e.g., Refs. 1-5, and 6). First of all, the valence-band holes are responsible for ferromagnetic (FM) order in the system mediating the exchange interaction between well-localized Mn magnetic moments. Spin-orbit coupling of the states at the top of valence band, being close to the Fermi level, leads to a rather strong cubic magnetocrystalline anisotropy (MCA) in bulk (Ga,Mn)As and to an in-plane biaxial MCA in the (Ga,Mn)As film on top of a GaAs substrate. [1][2][3] In the latter case the spin-orbit coupling (SOC) makes the valence states close to E F sensitive to lattice distortions and is in that way responsible for the in-plane MCA due to compressive strains originating from the lattice mismatch between the (Ga,Mn)As film and GaAs substrate. [7][8][9][10][11][12][13][14][15][16][17] As soon as the spin polarization of the valence bands becomes rather small, the MCA in (Ga,Mn)As is discussed in terms of anisotropic exchange interactions of the Mn atoms. 2,3,7 The strength of the MCA depends on the hole concentration introduced by the Mn impurity atoms 2,11,18,19 as well as on the variation of the equilibrium lattice parameter of (Ga,Mn)As, which increases with increasing Mn content and results thus in a larger lattice mismatch with the GaAs substrate.Numerous experimental results evidenced a temperature-induced transition from the biaxial to the uniaxial in-plane anisotropy in (Ga,Mn)As films deposited on GaAs. [11][12][13][14][15][16][17][18] In spite of different experimental conditions, the in-plane uniaxial anisotropy was observed for (Ga,Mn)As films in a thickness range from 25 nm (Ref. 20) to 500 nm, 16 irrelevant with respect to the surface condition. So far, however, to the best of our knowledge, there is no consensus in the literature concerning the origin of the in-plane uniaxial anisotropy. Although in some recent theoretical works the origin of the uniaxial in-plane anisotropy is attributed to a trigonal distortion caused by a uniaxial or shear strain within the film plane, 13,18,21 this type of distortion was not obser...