Long before there was a city, the Kumeyaay had a village on this spot called Pa-tai. The Kiliwa and Paipai, who also lived in the bay area and the inland valleys, are still here. Spanish ships arrived in the 16th century, when Juan Rodríguez Cabrillo reached the bay by sea, and in 1602 Sebastián Vizcaíno renamed it Ensenada de Todos Santos, 'bay of all saints'. His map-making was meant to find safe harbours for galleons coming home from Manila.
Missionaries came next. Jesuits made the first permanent settlement, and the Dominicans took over after the Jesuits were expelled in 1768. Wine came with the missions: the first vines on the peninsula are said to have been planted at San Ignacio in 1703 by the Jesuit Juan de Ugarte.
The town itself dates from 1882, when it was named capital of the northern part of the Baja California territory. Mines in the surrounding mountains drove its growth. The Mexican Revolution then left the area devastated, the capital moved to Mexicali in 1915, and by 1930 only 5,000 people lived here.
Prohibition in the United States helped it. Americans and Canadians went south for drink and entertainment, first to Tijuana, then Rosarito, then Ensenada. The Hotel Riviera del Pacífico opened in 1930 and drew a president and international artists. It closed in 1964 and later reopened as a cultural centre and museum.
Growth took off in the early 1950s, when the population reached 20,000. Fishing, cruise ships and science now shape the city. It has the only deep-water port in Baja California. In 2018 it had 279,765 people, which put it third in the state after Tijuana and Mexicali.