Mercury forms numerous compounds, assuming +1 valence in mercurous compounds and +2 valence in mercuric compounds. Mercury is not attacked by dilute hydrochloric or sulfuric acid. It reacts with hot nitric acid to form mercuric nitrate, Hg(No3)2. An excess of mercury reacts with nitric acid to form mercurous nitrate, HgNO3. Mercury reacts with hot concentrated sulfuric acid to form mercuric sulfate, HgSO4; with excess mercury, mercurous sulfate, Hg2SO4, is formed. Mercury reacts directly with the halogens to form mercuric salts. At elevated temperatures mercury reacts slowly with oxygen to form mercuric oxide, HgO. A mercurous oxide may be formed chemically but is unstable, decomposing to a mixture of mercury and mercuric oxide.