Catalyzes the pyrimidine ring opening between N-3 and C-4 by an unusual flavin hydroperoxide-catalyzed mechanism, adding oxygen atoms in the process to yield ureidoacrylate peracid, that immediately reacts with FMN forming ureidoacrylate and FMN-N(5)-oxide. The FMN-N(5)-oxide reacts spontaneously with NADH to produce FMN. Requires the flavin reductase RutF to regenerate FMN in vivo. RutF can be substituted by Fre in vitro. FMNH2 + NADH + O2 + uracil = (Z)-3-ureidoacrylate + FMN + H(+) + H2O + NAD(+) FMNH2 + NADH + O2 + thymine = (Z)-2-methylureidoacrylate + FMN + H(+) + H2O + NAD(+) Up-regulated by the nitrogen regulatory protein C (NtrC also called GlnG) and repressed by RutR. Cells lacking this gene lose the ability to utilize pyrimidine nucleosides and bases as the sole source of nitrogen at room temperature. The Rut pathway degrades exogenous pyrimidines as the sole nitrogen source at room temperature but not at 37 degrees Celsius, a restriction that is apparently a consequence of an inadequate ability to remove toxic malonic semialdehyde at the higher temperature (RutE/YdfG function). Belongs to the NtaA/SnaA/DszA monooxygenase family. RutA subfamily.