In this paper a probabilistic algorithm is exhibited that factors any positive integer n n into prime factors in expected time at most L n [ 1 2 , 1 + o ( 1 ) ] {L_n}[\tfrac {1}{2},1 + o(1)] for n → ∞ n \to \infty , where L x [ a , b ] = exp ( b ( log x ) a ( log log x ) 1 − a ) {L_x}[a,b] = {\text {exp}}(b{(\log x)^a}{({\text {log}}\log x)^{1 - a}}) . Many practical factoring algorithms, including the quadratic sieve and the elliptic curve method, are conjectured to have an expected running time that satisfies the same bound, but this is the first algorithm for which the bound can be rigorously proved. Nevertheless, this does not close the gap between rigorously established time bounds and merely conjectural ones for factoring algorithms. This is due to the advent of a new factoring algorithm, the number field sieve, which is conjectured to factor any positive integer n n in time L n [ 1 3 , O ( 1 ) ] {L_n}[\tfrac {1}{3},O(1)] . The algorithm analyzed in this paper is a variant of the class group relations method, which makes use of class groups of binary quadratic forms of negative discriminant. This algorithm was first suggested by Seysen, and later improved by A. K. Lenstra, who showed that the algorithm runs in expected time at most L n [ 1 2 , 1 + o ( 1 ) ] {L_n}[\tfrac {1}{2},1 + o(1)] if one assumes the generalized Riemann hypothesis. The main device for removing the use of the generalized Riemann hypothesis from the proof is the use of multipliers. In addition a character sum estimate for algebraic number fields is used, with an explicit dependence on possible exceptional zeros of the corresponding L L -functions. Another factoring algorithm using class groups that has been proposed is the random class groups method. It is shown that there is a fairly large set of numbers that this algorithm cannot be expected to factor as efficiently as had previously been thought.