What Year was Spain Founded?

There is really not a set year that Spain was founded. The United States was founded in 1776. At that time Spain was already hundreds of years old and after the US was founded, other countries evolved.