The first Spanish mission in California was built in 1769. The last mission was founded in 1823. There were 21 missions in total built along the coast of California between 1769 and 1823.
The missions were originally built by Spaniards to introduce Christianity to American Indians and turn the American Indians into Spanish citizens. The missions failed for several reasons, including low funding, backlash from American Indians, measles epidemics and food shortages.
The missions also faced political pressure. The settlements were originally Spanish territory, known as New Spain. Residents of New Spain revolted and overthrew Spain's control, leading to the creation of Mexico. Mexico was unwilling and unable to support the extensive mission system. The last mission was secularized in 1863, and the land and buildings were sold off or given to American Indians.