For any row-finite graph E and any field K we construct the Leavitt path algebra L (E) having coefficients in K. When K is the field of complex numbers, then L(E) is the algebraic analog of the Cuntz-Krieger algebra C*(E) described in [I. Raeburn, Graph algebras, in: CBMS Reg. Conf. Set. Math., vol. 103, Amer. Math. Soc., 2005]. The matrix rings M-n (K) and the Leavitt algebras L (1, n) appear as algebras of the form L(E) for various graphs E. In our main result, we give necessary and sufficient conditions on E which imply that L(E) is simple. (c) 2005 Elsevier Inc. All rights reserved.