Spain is generally safe at night, however, as with any country, it is important to take precautions. It is best to avoid walking alone in unfamiliar areas, especially at night, and to be aware of your surroundings. It is also recommended to avoid carrying large amounts of cash and to keep your valuables out of sight.