A search for scalar and vector leptoquarks coupling to first generation fermions is performed in the H1 experiment using data collected from 1994 to 2000. No significant evidence for the direct production of such particles is found in a data sample with a large transverse momentum final state electron or with large missing transverse momentum, and constraints on leptoquark models are established. For leptoquark couplings of electromagnetic strength, leptoquark masses up to 290 GeV are ruled out.