The Beginnings of San Francisco
Under the rule of Spain the administration of California was purely military. The territory was divided into four districts, each under the protection of a military post known as a presidio.  A presidio was a walled camp about six hundred feet square whose walls of adobe were some fourteen feet high and five feet thick with small bastions flanking the angles. The walls had but one gate and were surrounded by a ditch twelve feet wide and six feet deep. Its armament generally consisted of eight bronze cannon—eight, twelve, and sixteen pounders. Although incapable of resisting an attack of ships of war these fortifications were sufficient to repel the incursions of Indians. Not far from the presidio was the fort or battery, called the castillo. Within the enclosure of the presidio were the church, the quarters of the officers and soldiers, the houses of colonists, store houses, workshops, stables, wells, and cisterns. The military reservation of a fort or presidio (egidos) as laid down by law was equal to a square of three thousand varas;  that is, fifteen hundred varas measured to "each wind" (cardinal point) from the center of its plaza. If the lay of the land was such that the measurement could not be made in the form of a square, the required quantity was to be made up by measurements in other directions. The commander of the presidio had full jurisdiction within his district, subject to the approval of the governor. The governor, who was an officer of the army, held his appointment from the viceroy of New Spain; there was neither a legislative body nor council, the governor executing the orders of the viceroy and being responsible to him only. Each presidio furnished to the missions within its district, a guard (escolta) varying from five to eight soldiers under command of a corporal or sergeant, and also a guard of from two to five soldiers to each pueblo, keeping in the presidio as a garrison and for escort duty, expeditions, etc., from twenty to thirty men.
The small military establishment of California excited the wonder of foreign naval commanders visiting the coast. They could not understand Spain's neglect of a country of such great natural resources. The excellence of its climate, the fertility of its soil, the spaciousness of its harbors, rendered possible the creation of a province of great power and influence on the coast of the Pacific. Vancouver, writing in 1793, after describing the beauty of the country, its climate, soil, etc., says: "From this brief sketch some idea may be formed of the present state of the European settlements in this country, and the degree of importance they are to the Spanish monarchy, which retains the extent of country under its authority by a force that, had we not been eye-witnesses of its insignificance in many instances, we should hardly have given credit to the possibility of so small a body of men keeping in awe and under subjection the natives of this country, without resorting to harsh or unjustifiable measures. The number of their forces between port St. Francisco and San Diego, including both establishments, and occupying an extent of one line of upwards of four hundred and twenty nautical miles, does not amount to three hundred, officers included. * * *
"Should the ambition of any civilized nation attempt to seize on these unsupported posts (the presidios of San Francisco, Monterey, Santa Barbara, and San Diego) they could not make the least resistance and must inevitably fall to a force barely sufficient for garrisoning and securing the country.” 
The force at the time of Vancouver's visit was two hundred and twenty-five men all told. It was increased in 1795 to two hundred and eighty, and in 1796 a company of seventy-five Catalan volunteers (infantry), and eighteen artillerymen were added, raising the force to three hundred and eighty-five men, the largest number it attained.
Until 1804 the two Californias were united under one governor, but in 1805 a separate governor was appointed for Lower California. The first governor of the Californias, Gaspar de Portolá, was a captain of dragoons. His successors held the rank of lieutenant-colonel. The presidios were each commanded by a lieutenant, but in 1805 these officers were raised to the rank of captain and henceforth the comandante held that rank. The capital of the Californias until 1777 was Loreto, in Lower California, Alta California being ruled by the comandante. In November 1777, the governor, Felipe de Neve, by order of the king, removed his office to Monterey, which henceforth with exception of a brief interval was the capital.
In the Mexican war for independence California took no part, and the sympathy of the people, so far as it was manifested, was with Spain. During the long struggle California suffered from neglect. For ten years the troops received no pay and but for the assistance rendered them by the missions, must have starved. The transports, which had twice a year brought supplies to the presidios, failed to appear and the result was great distress to the garrisons. The supplies collected in 1810 for the California presidios were captured by the insurgent forces, and those collected in 1811 were held in Mexico for fear they would fall into the hands of the rebels while being conveyed to the coast. In 1812 the Russian-American company established a post at Bodega, a few miles north of San Francisco, built a fort, which they called Ross, and issued a proclamation expressing a wish to establish commercial relations with their friends and neighbors, the noble and brave Spaniards of the Californias, and offering to supply them with the various lines of goods which they needed. Trade was forbidden the province, but the necessities of the governor (Arrillaga) compelled him to supply from the Russian company some of the most imperative needs of the presidios. Another source of supply was the foreign ships visiting the coast for the skins of fur animals. This trade was, of course, strictly forbidden, but the smugglers managed to land goods from time to time to the great profit of those concerned and the relief of the needy inhabitants. For beef and produce the governor made his requisitions on the missions, giving in payment his drafts on the real hacienda,  and in 1820 the missions held unpaid treasury drafts for hundreds of thousands of dollars. For ten years the padres supported the province and during that entire time received no salaries. There was no increase of population during this period beyond a few soldiers sent from Mexico and the natural increase in the families.
In November 1818, two ships flying the flag of the Buenos Aires insurgents suddenly appeared off Monterey and the commander, Captain Hippolyte Bouchard, a piratical adventurer, landed three hundred men and captured and plundered the presidio. The pirate then sailed south, plundered and burned the buildings of the Refugio rancho near Santa Barbara, and then departed without doing further damage in California. The news reached Mexico in December and a company of one hundred infantry was sent from San Blas and a cavalry company of one hundred men from Mazatlan, to reinforce the presidios. The San Blas infantry was composed of cholos—convicts and vagabonds of the lowest description—and they gave the Californians an infinite amount of trouble before they succeeded in getting rid of them.
After the independence of Mexico California became a territory of that republic and entitled to one diputado in its congress. The first territorial diputacion was organized at Monterey, November 9, 1822. It was composed of seven members, two substitutes, and a secretary. Each of the four presidial districts: Monterey, San Francisco, Santa Barbara, and San Diego, was represented by a member, one from the pueblo of Los Angeles, one at large, and the governor, ex-officio president. This was the first legislature of California. It was, however, more of the nature of a council than a legislative body. Its resolutions had to be sent for approval to the supreme government at Mexico. Figueroa said, in referring to its powers, "The Diputacion never had the vain pretension to attribute to any of its determinations the force of laws.”  In 1827 the diputacion adopted a resolution changing the name of California to Moctezuma, but the government at Mexico, fortunately, did not give its approval.
In 1825 a special board, the Junta Fomento de Californias, was assembled in the City of Mexico to formulate plans for the government and colonization of the territory. It was composed of the most distinguished statesmen and lawyers of Mexico, and among them was Don Pablo Vicente de Sola, who had for seven years been governor of California. This board while recognizing the benefits resulting from the Spanish system of discoveries and conquests felt that the time had come when the natives should be aroused to a desire for civil and social life. They recommended a change in the monastic system of administration, that the government assume the administration of the mission temporalities, and that the lands be distributed to the Indians. The report of the junta was published in 1827 and formed the basis for the reglamento of November 21, 1828.  In regard to the distribution of lands however, the reglamento provided that those occupied by the missions could not be colonized until it was determined whether they were to be considered as the property of the establishments of the neophytes, catechumens, and Mexican colonists. The Indians must first be provided for and this Governor Figueroa undertook to do in his reglamento of August 9, 1834, before alluded to, in which he decreed that to every individual head of a family and to all those above twenty-one years of age, although they have no family, should be given a lot of land not less than one hundred nor more than four hundred varas square, a portion of the self-moving property (cattle) and of the chattels, tools, instruments, and seeds on hand. Also in cummunity, a sufficient quantity of land for pasturing and watering their cattle.
Mexican independence was followed by the regency; that by the empire of Iturbide, and the empire, in turn, by the republic. The federal constitution was received in California in January 1825, and ratified by the diputacion the following March. The padres did not take kindly to the republic. Most of them were born in Spain and their sympathies were with the monarchy. They refused to take the oath of allegiance and until compelled refused to furnish supplies to the presidios. The ratification of the constitution by the diputacion was unaccompanied by the religious ceremony customary on such occasion, as Padre Sarría, comisario prefecto,  did not approve of the republic. Though the attitude of the priests caused some angry protests, and the Indians, under their influence, gave signs of disaffection, they continued to rule over the temporal as well as the spiritual affairs of their respective missions.
While the general condition of the mission pueblos was one of peace and content, severe treatment for petty offences caused, in several instances, serious revolt. In 1824 the Indians of Santa Inés, La Purisima, and Santa Barbara rose simultaneously, and it was with some difficulty and at a cost of several lives that peace was restored; and while several of the ring leaders were severely dealt with for their activity in inciting the revolt the padres used their influence to soften the punishment inflicted upon their wards, and the Indians who had fled to the wild tribes of the Tulares gradually returned to their mission homes. In 1835, Ensign Vallejo was ordered by Governor Figueroa to establish a garrison town and colony on the northern frontier to hold the heathen tribes in subjection and serve as a check to the advance of Russian settlement. Vallejo with a small force of soldiers established the post at the ex-mission of San Francisco Solano, then in process of secularization, and laid out a pueblo to which he gave the name of Sonoma (Valley of the Moon), the Indian name for the valley. To this post he transferred the San Francisco company, leaving at Fort San Joaquin a few artillerymen, to care for the guns. Vallejo was raised to the rank of lieutenant and made commander of the northern frontier. He was now twenty-nine years old and a thoroughly trained soldier, having entered the army at the age of seventeen. He had been in command of the San Francisco presidio for several years and had had the experience of several Indian campaigns. With a comparatively strong company at his command he pursued a wise policy toward the Indians, protecting them when at peace, but punishing severely any manifestation of hostility. He was a strict disciplinarian and possessing an imperious character, he permitted no interference with his military command and preserved the peace of the frontier. He formed an alliance with Solano, chief of the Suisunes, and with his assistance ruled the tribes of the north, many of whom were brave and warlike.
The Californians were becoming tired of the way in which their province was governed by distant Mexico and believed that the officials to rule California should be chosen from among the educated and competent men of the country instead of men sent from Mexico. They rose and expelled Governor Victoria in 1831, and later, in 1836, Governor Chico. Chico in leaving California turned over the command, civil and military to Lieutenant-colonel Nicolas Gutierrez, who became governor ad interim. The diputacion resented this believing the control should have been left with them. In 1836 the Californians of the north rose in revolt and headed by Juan Bautista Alvarado, a young Californian of marked ability, drove Gutierrez from the country. In this rebellion Alvarado was assisted by a Tennessean named Isaac Graham, a mountaineer hunter and trapper, a crack shot, and a man ready for any desperate adventure. Graham had come into California from New Mexico three years before and had set up a distillery in the Salinas valley at a place called Natividad, making his house a resort for runaway sailors and other foreigners as wild and reckless as himself. To Graham came Alvarado for help which was readily granted, and Graham raised a company of some fifty foreign riflemen and, joining forces with the Californians under José Castro, marched, one hundred and fifty strong, against Monterey. Gutierrez surrendered and was sent with his officers to Cape San Lucas on the English brig Clementine, November 11, 1836. The diputacion declared California independent of Mexico, elected Alvarado governor and called Vallejo to the comandancia-general. In the south, Los Angeles and San Diego refused to recognize Alvarado as governor and would not agree to the separation from Mexico. Alvarado went south with a force to meet the opposition arrayed against him, but before any collision took place he realized that to succeed he must give up the idea of an independent state and submit himself to the constitutional authority. This he did, sending a special commissioner to Mexico. Meanwhile, under the influence of José Antonio Carrillo, diputado for California, the supreme government had appointed Cárlos Antonio Carrillo, brother of the diputado, governor. Alvarado refused to surrender the office and after several skirmishes made prisoners of Carrillo and the southern leaders, but soon released them, and the supreme government reconciled the belligerents by recognizing Alvarado as governor and compensating the Carrillos by the gift of the island of Santa Rosa.
The laws of December 1836 made the Californias a department of the republic. The diputacion became the junta departmental, Alta California, divided into two districts, and each district into two partidos. A district was governed by a prefect whose authority was second to the governor and he was appointed by the governor subject to the approval of the supreme government, while a partido was governed by a sub-prefect who was appointed by the prefect, subject to the approval of the governor. The first district extended from the Sonoma frontier to San Luis Obispo, with the head-town (cabecera) at San Juan Bautista, and the second district from El Buchon to Santo Domingo on the peninsula frontier, with the cabecera at Los Angeles. The line of division of the first district was Las Llagas creek, and San Francisco was the cabecera of the second partido. The line dividing the second district was between San Fernando and Cahuenga. Vallejo was made comandante-militar of California and received a commission as colonel of defensores de la patria. He exerted himself to bring the military establishment into something like efficiency. The country was defenseless and it was Vallejo's opinion that in the restoration of the presidial companies lay its hope of salvation. With the exception of the San Francisco company maintained at Sonoma by Vallejo from his personal resources, there was hardly pretense of a military force in California. The roster of the presidial company of Monterey showed in 1841 twenty-two men, all told, and that of Santa Barbara, twenty-five. At San Diego, where, in 1830, there was an effective force of one hundred and twenty men, the company had entirely disappeared, the presidio was abandoned and in ruins; the fort on Punta Guijarros (Ballast Point), which in 1830 mounted thirteen guns, was abandoned, and in 1840 sold for forty dollars. The guns seem to have remained at the fort, as it is stated that Captain W. D. Phelps of the American ship Alert, loading with hides at San Diego, spiked the guns of the fort on hearing of Commodore Jones' action at Monterey, fearful that his ship and cargo would be seized by Governor Micheltorena. The militia companies (defensores de la patria) existed mainly on paper. Vallejo urged his views upon the governor and also appealed to Mexico, laying before the minister of war the need of repairs to the fortifications, explaining the danger of foreign encroachments and stating that he could no longer maintain the military force on the northern frontier from his own means. He asked for money, arms, and munitions of war. He received some arms, ammunition, uniforms, etc., and was given authority to reorganize the presidial companies. A few recruits were obtained but they were of such a character that he could not accept them, and for money he was obliged to content himself with the small share of the revenue duties apportioned to the army. The soldiers, not receiving their pay, went to work on the ranchos to support their families. [Note 28]
During the interregnum following the expulsion of Governor Victoria, the foreigners living at Monterey were enrolled for the defense of the town. The Compania Extranjera, as it was called, was organized in January 1832 and forty-six men signed the rolls. Among them were W. E. P. Hartnell, Nathan Spear, Captain J. B. R. Cooper, Thomas Doak, George Kinlock, James Watson, and Henry Bee. Hartnell was elected captain and J. B. Bonifacio, lieutenant. Bancroft says the company disbanded in April.
In January 1841 Vallejo laid before the supreme government his dissatisfaction with the administration of Alvarado and his conviction that it would be wise to unite the civil and military commands under one head. He reiterated his recommendation for the restoration of the presidial companies and asked to be relieved of his command and permitted to visit the national capital. Later Governor Alvarado reported the arrival in California of a party of thirty armed Americans from Missouri and of another party of foreigners from New Mexico,  and suggested the sending of one hundred and fifty or two hundred men to reinforce the presidios.  The opportunity was thus offered the home government to reestablish its authority in California, and Brigadier-general Don Manuel Micheltorena was appointed governor, comandante-general, and inspector, and a battalion of five hundred men was authorized for service in California, of whom two hundred were to be regular troops and three hundred were to be recruited from the prisons of Mexico. Of the regulars the most undesirable men were assigned for duty in California. With this promising material the general started for his new department, his ranks thinning by desertion as he went. The army was known by the pretentious title of the Batallon Fijo  de Californias, and of the five hundred enlisted, about three hundred and fifty reached California. Robinson, who was in San Diego in August 1842 when the first detachment landed, says: "The brig Chato arrived with ninety soldiers and their families. I saw them land and to me they presented a state of wretchedness and misery unequaled. Not one individual among them possessed a jacket or pantaloons; but naked, and like the savage Indians, they concealed their nudity with dirty, miserable blankets. The females were not much better off; for the scantiness of their mean apparel was too apparent for modest observers. They appeared like convicts and, indeed, the greater portion of them had been charged with crimes either of murder or theft. And these were the soldiers sent to subdue this happy country! These were the valiant followers of a heroic general, who had fought on the battlefield where he had gained laurels for himself and country. These were to be the enforcers of justice and good government. Alas! poor California! when such are to be thy ministers, thou art indeed fallen! The remainder of the 'convict army' arrived in course of time, and I had an opportunity of seeing them all afterwards at the Pueblo (Los Angeles) when on their route towards Monterey, the seat of government. They mustered about three hundred and fifty men, and their general had given them, since their arrival, a neat uniform of white linen. Here their stay was protracted in order to drill and prepare for service, in case of opposition from Señor Alvarado. "  Both Robinson and Bancroft intimate that Micheltorena 's cholos  were more proficient in foraging for supplies by night than they were in the drill during the day. After a month's stay at Los Angeles Micheltorena resumed his march to Monterey, but had proceeded no further than San Fernando when he received an extraordinario from Alvarado with dispatches to the effect that Commodore Jones had anchored in the port of Monterey and had demanded the surrender of the place on the day following (October 20th). Micheltorena received the dispatch on the night of the 24th and at once began his preparations for a retreat to Los Angeles, ordering all available forces and supplies concentrated there, but before he could get under way he received a message from Jones himself to the effect that Monterey had been restored. Micheltorena replied saying that he was marching to meet the invader and expel him from the country, but as he had seen fit to withdraw he demanded a personal conference at Los Angeles that the satisfaction rendered by the American commander might be as public as the outrage. To this reasonable demand Jones assented and with several of his officers landed at San Pedro where he was met and escorted to Los Angeles. With many compliments and toasts the ethics of international law were satisfied and the Mexican general gave Jones and his officers a ball at which they all had a jolly good time, and departed well pleased with their entertainment.
Micheltorena' s courteous manners and gentlemanly conduct won him many friends, particularly among the foreigners, but it was with the greatest difficulty that he found means to sustain his army. Indeed it was said that his cholos maintained themselves—by stealing. Contributions were received from citizens and Vallejo responded liberally to the general's appeal, as did José Yves Limantour, a French trader on the coast, of whom we shall hear more later. Micheltorena remained in Los Angeles until midsummer and then marched his batallon to Monterey, much to the delight of the cholos, who had, it is said, stolen everything eatable in the south.
In July 1844, Micheltorena ordered the enrolment of all citizens between the ages of fifteen and sixty, including naturalized foreigners, to be formed into nine companies of militia and drilled every Sunday. They were to hold themselves in readiness to be called into active service. This was in accordance with orders from Mexico, in anticipation of a war with the United States. The governor established his headquarters at San Juan Bautista where he assembled his ammunition stores and where he determined to make his last stand against the invader. These stores fell into the hands of a small revolutionary party under Manuel Castro in November 1844, at the beginning of an uprising that drove Micheltorena from power. In March 1845, the defeated governor, accompanied by his officers and about two hundred of his cholos, sailed for San Blas in the American brig Don Quixote, Captain John Paty, and Pio Pico, first vocal of the junta departmental, reigned as governor in California.
Some of Micheltorena's convict soldiers who through desertion or other causes were left in California, and who began to commit acts of rapine, robbery, and murder were hunted down like wild beasts and destroyed.
Vallejo had failed in his plan to rehabilitate the presidial companies. His appeal to the supreme government had only resulted in the shipment to the country of a lot of convicts. The new governor, though an hijo del pais, was a dull, stupid man, and the reins were held with a feeble grasp. [Note 29]
This then was the deplorable condition of California on the eve of its conquest by the Americans. Neglected by Mexico, its presidial soldiers disbanded and its forts in ruins, it lay defenseless, a prey to the first comer who cared to take and hold possession.