Yes, a license is legally required to operate a 50cc moped in Spain. The minimum age to obtain this license is 15 years old.
To earn the license (category AM), you must pass two exams:
The AM license permits riding mopeds up to 50cc with a maximum speed of 45 km/h. It's valid throughout Spain and recognized in other EU countries. Riders must wear an approved helmet at all times, and the moped must be insured and registered.
If you already hold a full car license (category B), you may ride a 50cc moped without additional testing, provided you're over 18 (or 15 with specific conditions). Always verify current regulations with the Dirección General de Tráfico (DGT) before riding.