We have performed direct numerical simulation of the turbulent flow of a polymer solution in a square duct, with the FENE-P model used to simulate the presence of polymers. First, a simulation at a fixed moderate Reynolds number is performed and its results compared with those of a Newtonian fluid to understand the mechanism of drag reduction and how the secondary motion, typical of the turbulent flow in non-axisymmetric ducts, is affected by polymer additives. Our study shows that the Prandtl’s secondary flow is modified by the polymers: the circulation of the streamwise main vortices increases and the location of the maximum vorticity moves towards the centre of the duct. In-plane fluctuations are reduced while the streamwise ones are enhanced in the centre of the duct and dumped in the corners due to a substantial modification of the quasi-streamwise vortices and the associated near-wall low- and high-speed streaks; these grow in size and depart from the walls, their streamwise coherence increasing. Finally, we investigated the effect of the parameters defining the viscoelastic behaviour of the flow and found that the Weissenberg number strongly influences the flow, with the cross-stream vortical structures growing in size and the in-plane velocity fluctuations reducing for increasing flow elasticity.