Summary. A direct method is developed for solving linear least squares problems min ]lAx-btl2, where A is large and sparse and the solution is subject x to lower and upper bounds l<_x<_u. The problem is initially transformed to upper triangular form by a sparse QR-factorization. An active set algorithm is then used. The key step is the stable updating of the R-factor associated with the columns of A corresponding to the free variables, when the Q-factor is not available. For this a new method is developed, which uses the semi-normal equations and iterative refinement.