Del Martin, 83, and Phyllis Lyon, 79, said "I do" after Mayor Gavin Newsome ordered officials to wed gay couples and issue marriage licences despite a state law which bars same-sex unions.
The pair, who are long-standing gay activists, have been a couple for more than 50 years.
"We got married," said one of the women ecstatically after the ceremony on Thursday.
The newly-weds said they did not plan to celebrate the marraige but seemed proud of what they had done. "Why shouldn't we be able to marry?" Lyon said.
City official Mabel Teng presided over the ceremony, exchanging the traditional phrase of "Husband and wife" for "spouse for life".
"This is a very significant day for Del and Phyllis and for all of us witnessing this historic ceremony"
San Francisco city hall
He said: "This is a very significant day for Del and Phyllis and for all of us witnessing this historic ceremony."
Newsome, who took over the liberal city after winning an election in December, announced he would defy state law and marry gay couples in a bid to fight discrimination.
At least six other same-sex couples were married in San Francisco on Thursday.
According to Equality for California Families, a pro-gay rights group, there are at least 100,000 households in the state headed by same-sex partners.
A significant proportion of these couples are rasing children together.
The group says married couples are currently given more legal rights by state laws, and there is no good reason to deny these privileges to committed same-sex couples.
It argues that granting more rights to stable gay couples would encourage lasting family relationships, and would protect family members from ecomomic abandonment, separation and the death of loved ones.
The marriage ceremony came a day before a conservative, pro-family group planned to go to court to get an injunction preventing the city from issuing wedding licences to gay couples.
The Campaign for California Families say same-sex marriages violate the sanctity and uniqueness of marriage, thus threatening an institution which is key to raising well-balanced children.
Schwarzenegger says marriage is
between a man and a woman
The group also seems to have the backing of new California Governor Arnold Schwarzenegger, who is on record as saying "Marriage is something that should be between a man and a woman".
The San Francisco ceremony also contradicts a ballot measure approved by California voters that defines marriage as a union between a man and a woman.
At the moment, no American state legally sanctions gay marriage, although Massachusetts could become the first to do so later this year.
The Massachusetts high court has ruled that gays are entitled under the state constitution to marry.