<p>The traditional medicinal herb, <em>Hypericum perforatum </em>L. has been popular for its pharmaceutical and coloring wealth since the ancient era. A secondary metabolite from the group of naphthodianthrones in <em>Hypericum </em>spp<em>.</em> named hypericin is responsible for the antidepression, anticancer, and antiviral characteristics of this herb. It has been found that several genes are involved in the biosynthesis pathway of hypericin. The <em>hyp-1</em> gene is participating in this biosynthesis path through the conversion of emodin to hypericin. The naphthodianthrones (hypericin and pseudohypericin) in <em>Hypericum</em> are synthesized through the polyketide pathway. In the plants, the enzyme complexes named polyketide synthase (PKS) catalyzes the reactions of polyketide pathways. The genes <em>HpPKS1</em> and <em>HpPKS2</em> are encoding PKS enzyme complexes. In this research, the relative expression of <em>hyp-1</em>, <em>HpPKS1,</em> and <em>HpPKS2</em> genes was compared in root and leaves of <em>Hypericum</em><em> perforatum </em>and<em> H. androsaemum </em>L., before and after flowering under urea fertilization at 24, 48 and 72 hours after irrigation. The highest expression level of all three genes was observed after flowering in the samples of <em>H. perforatum</em> that were fertilized 72 hours after irrigation by 1 g l<sup>-1</sup> urea (<em>hyp-1</em> in roots; <em>HpPKS1</em> and <em>HpPKS2</em> in leaves). The relative expression of <em>hyp-1</em> in the root was greater than in the leaves, but <em>HpPKS1</em> and <em>HpPKS2</em> expression in leaves was higher than in root. The relative expression of all three genes in <em>H. perforatum</em> was higher than in <em>H. androsaemum</em>. By increasing the interval between urea fertilization and irrigation, the relative expression of genes had an increasing trend, also by increasing the amount of urea fertilizer, relative gene expression was increased.</p>