This work is concerned with the numerical solution of large-scale linear matrix equations A1XB1T++AKXBKT=C. The most straightforward approach computes XRmxn from the solution of an mn x mn linear system, typically limiting the feasible values of m,n to a few hundreds at most. Our new approach exploits the fact that X can often be well approximated by a low-rank matrix. It combines greedy low-rank techniques with Galerkin projection and preconditioned gradients. In turn, only linear systems of size m x m and n x n need to be solved. Moreover, these linear systems inherit the sparsity of the coefficient matrices, which allows to address linear matrix equations as large as m = n = O(10(5)). Numerical experiments demonstrate that the proposed methods perform well for generalized Lyapunov equations. Even for the case of standard Lyapunov equations, our methods can be advantageous, as we do not need to assume that C has low rank. Copyright (c) 2015 John Wiley & Sons, Ltd.