The California Supreme Court on Tuesday upheld Proposition 8, last year's successful ballot measure that banned same-sex marriage in the Golden State.

The court also ruled in Strauss v. Horton, though, that the state should continue to recognize same-sex marriages that have already taken place in the state.

In May of 2008, the California Supreme Court ruled that the state's constitution protects a "right to marry" that allows same-sex couples to wed.

About 18,000 same-sex couples have married in California since then.

Observers expected this ruling because it is difficult for courts to overrule a state wide vote.

Prop. 8 sought to amend the state's constitution to define marriage as between a man and woman. The ballot measure passed with 52 percent of the vote last November.

Opponents of the ballot measured appealed the results on the grounds that it amounted to a revision of the state constitution, which is only allowed to be placed on the ballot by a two-thirds vote of the state legislature. Prop. 8 was put on the ballot after collecting the requisite number of signatures.

When California legalized same-sex marriage in 2008, it became the second state, after Massachusetts, to do so. Currently five states have legalized it: Massachusetts, Connecticut, Iowa, Vermont and Maine. The state legislatures of New Hampshire, New York and New Jersey are also considering legislation that would legalize it in those states.