Hydrogen gas (H2) was generated by reacting magnesium metal (Mg, below) with hydrochloric acid (HCl).