Yerba Buena was the original name of the settlement that later became San Francisco, California. Located near the northeastern end of the San Francisco Peninsula, between the Presidio of San Francisco and the Mission San Francisco de Asís, it was originally intended as a trading post for ships visiting San Francisco Bay. The settlement was arranged in the Spanish style around a plaza that remains as the present day Portsmouth Square.
The name of the town was taken from the yerba buena (Micromeria douglasii) plant, native to the pueblo site. Franciscan missionary Pedro Font, accompanying the Juan Bautista de Anza expedition of 1775-76, applied the Spanish name to the common native herb he found abundant in the landscape. The plant's common name, yerba buena, the same in English and Spanish, is an alternate form of the Spanish hierba buena (meaning "good herb").
The earliest report of the use of Yerba Buena as a place name comes from the log of George Vancouver, who in 1792 sailed his ship HMS Discovery into San Francisco Bay and anchored "about a league below the Presidio in a place they called Yerba Buena".
The Spanish Portolá expedition, led by Don Gaspar de Portolá arrived overland from Mexico on November 2, 1769. It was the first documented European visit by land to the San Francisco Bay Area, claiming it for Spain as part of the Viceroyalty of New Spain.
A second group of soldiers, this time accompanied by settlers, arrived in June 1776, led by the Spanish explorer Juan Bautista De Anza. One of De Anza's officers, José Joaquín Moraga, was given the task of building a Spanish mission, Mission San Francisco de Asís (Mission Dolores) and a military fort, the Presidio of San Francisco. Moraga chose a location approximately halfway between the two sites to build housing for the workers, which became known as Yerba Buena. A supply ship arrived about two months later and the settlers began building.
Upon independence from Spain in 1821, the territory of Alta California became part of Mexico, but the faraway Mexican government paid little attention to Yerba Buena. Over the years the area between the port facilities at Yerba Buena Cove and the housing area of Yerba Buena filled in. The old plaza is today's Portsmouth Square.
In 1835, Englishman William A. Richardson erected a homestead near the boat anchorage of Yerba Buena Cove. Together with Alcalde Francisco de Haro, he laid out a street plan for the expanded settlement, which retained the name Yerba Buena.
In early 1841 James Douglas of the Hudson's Bay Company (HBC), operating on the Pacific coast from Fort Vancouver, went to Yerba Buena to establish an HBC trading post. A large building on the water's edge was purchased. The HBC post had several purposes. It operated as a wholesale store, selling goods exported from Fort Vancouver such as salmon, lumber, and British manufactures in exchange for hides and tallow. The post improved diplomatic relations between the British HBC and the Mexican government of California, making the HBC's fur trapping expeditions into California's Central Valley politically acceptable. Despite the mercantile potential of the HBC store in Yerba Buena, in 1842 it was ordered to be closed by George Simpson as part of Simpson's general reorganization of the HBC's Columbia District. The HBC store in Yerba Buena was sold in 1846, two years before the California Gold Rush transformed Yerba Buena into the major city on the North American west coast.
On July 7, 1846, US Navy Commodore John D. Sloat, in the Battle of Yerba Buena, claimed Alta California for the United States during the Mexican-American War, and US Navy Captain John Berrien Montgomery and US Marine Second Lieutenant Henry Bulls Watson of the USS Portsmouth arrived to claim Yerba Buena two days later by raising the American flag over the town plaza, which is now Portsmouth Square in honor of the ship. Henry Bulls Watson was placed in command of the garrison there. On July 31, 1846, Yerba Buena doubled in population when about 240 Mormon migrants from the East coast arrived on the ship Brooklyn, led by Sam Brannan. In August 1846, Lt. Washington Allon Bartlett was named alcalde of Yerba Buena. On January 30, 1847, Lt. Bartlett's proclamation changing the name Yerba Buena to San Francisco took effect. The city and the rest of Alta California officially became a United States military territory in 1848 by the terms of the Treaty of Guadalupe Hidalgo, which ended the Mexican-American War. California was admitted for statehood to the United States on September 9, 1850. The State soon chartered San Francisco as both a City and a County.