We describe basic elements and implementation of the adaptive integral method (AIM): a fast iterative integral-equation solver applicable to large-scale electromagnetic scattering and radiation problems. As compared to the conventional method of moments, the AIM solver provides (for typical geometries) significantly reduced storage and solution time already for problems involving 2,000 unknowns. This reduction is achieved through a compression of the impedance matrix, split into near-field and far-field components. The near-field component is computed by using the Galerkin method employing a set of N arbitrary basis functions. The far-field matrix elements are calculated by using the Galerkin method as well, with a set of N auxiliary basis functions. The auxiliary basis functions are constructed as superpositions of pointlike current elements located on uniformly spaced Cartesian grid nodes and are required to reproduce, with a prescribed accuracy, the far field generated by the original basis functions. Algebraically, the resulting near-field component of the impedance matrix is sparse, while its far-field component is a product of two sparse matrices and a three-level Toeplitz matrix. These Toeplitz properties are exploited, by using discrete fast Fourier transforms, to carry out matrix-vector multiplications with O(N3/2log N) and O(N log N) serial complexities for surface and volumetric scattering problems, respectively. The corresponding storage requirements are O(N3/2) and O(N). In the domain-decomposed parallelized implementation of the solver, with the number Np of processors equal to the number of domains, the total memory required in surface problems is reduced to O(N3/2/NP1/2). The speedup factor in matrix-vector multiplication is equal to the number of processors Np. We present a detailed analysis of the errors introduced by the use of the auxiliary basis functions in computing far-field impedance matrix elements. We also discuss the algorithm complexity and some aspects of its implementation and applications.