We prove a decomposition theorem for even-hole-free graphs. The decompositions used are 2-joins and star, double-star and triple-star cutsets. This theorem is used in the second part of this paper to obtain a polytime recognition algorithm for even-hole-free graphs.