We present the first radial velocities and ground-based photometric observations of V1665 Aql and AG Ari. These double-lined eclipsing binaries have eccentric orbits with eccentricities of 0.24 and 0.09, respectively. New UBV photometric data and radial velocities were analysed using a modified version of the Wilson-Devinney program for the parameters of the systems. Good phase coverage and relatively small scatter both in the light and in the radial-velocity curves meant that the eccentricity and the argument of periastron as well as orbital and stellar parameters could be determined. Our solutions indicate that AG Ari includes a third light with a considerable amount of 5.6 per cent in U, 6.4 per cent in B, and 9 per cent in V. By comparing its light contribution with the total light we classified it as an F-type star. The components in each system are of very nearly equal mass, temperature, and luminosity. Their absolute parameters were compared with those of stars belonging to well-studied detached eclipsing binaries. The components lie well inside the main-sequence band. In addition, the apsidal motion rates of the system have been determined from an analysis of all the photometric observations obtained by space missions and by us. We determined the preliminary apsidal motion periods of the systems to be 449 +/- 34 yr for V1665 Aql and 155 +/- 6 yr for AG Ari. Because well-detached eclipsing binaries are optimal distance indicators, we estimated the distances to V1665 Aql and AG Ari to be 477 +/- 40 and 292 +/- 18 pc from the determined absolute visual magnitudes and interstellar extinction. A comparison with evolutionary tracks indicates that the primary component of V1665 Aql has an age of about 1.6 x 10(8) yr and is near the main-sequence terminal age. The components of AG Ari are intermediate-mass main-sequence stars with an age of about 5.6 x 10(8) yr.