While US voters selected US President Barack Obama to a second term on Tuesday, several measures were also up for a vote on state ballots, with gay marriage and legalized marijuana making historic gains.Maryland voters on Tuesday approved same-sex marriage, while similar measures in Maine and Washington state also appeared on track to pass, marking the first time marriage rights have been extended to same-sex couples by popular vote. The approval was a watershed moment for gay rights activists because while same-sex unions have been legalized in six states and the District of Columbia by lawmakers or courts, voters until Tuesday had consistently rejected the issue. Voters in more than 30 states have approved constitutional bans on gay marriage."It's enormous. We have truly made history," said Brian Ellner, the head of the pro-gay marriage group The Four. "Having the first states approve marriage by a popular vote changes the narrative and sends an important message to the Supreme Court."In Maryland, the gay-marriage measure passed 52 percent to 48 percent, with 93 percent of precincts reporting. In Maine, it was leading by 54 percent to 46 percent, with more than 62 percent of precincts reporting. And in Washington, it was leading by 52 percent to 48 percent, with 61 percent of precincts reporting.In Minnesota, meanwhile, voters appeared to be leaning against adding that state to the list of those defining marriage solely as a heterosexual union. With more than 78 percent of precincts reporting, the proposed constitutional amendment was trailing 49 percent to 51 percent.The constitutionality of restricting marriage to unions between a man and a woman is widely expected to be taken up by the US Supreme Court soon.Colorado first to legalize recreational marijuanaMeanwhile, Colorado became the first state to legalize the possession and sale of marijuana for recreational use on Tuesday, setting up a possible showdown with the federal government as backers of a similar measure in Washington state declared victory.A third measure to remove criminal penalties for personal possession and cultivation of recreational cannabis was defeated in Oregon, where significantly less money and campaign organization was devoted to the cause.Supporters of a Colorado constitutional amendment legalizing marijuana declared victory and opponents conceded defeat after returns showed the measure garnering nearly 53 percent of the vote versus 47 percent against."Colorado will no longer have laws that steer people toward using alcohol, and adults will be free to use marijuana instead if that is what they prefer. And we will be better of as a society because of it," said Mason Tvert, co-director of the Colorado pro-legalization campaign.The legalization puts the state in direct conflict with the federal government, which classifies cannabis as an illegal narcotic.The US Department of Justice reacted to the measure's passage in Colorado by saying its enforcement policies remain unchanged, adding: "We are reviewing the ballot initiative and have no additional comment at this time."In Washington, cannabis legalization was passing by a handy margin, according to state returns, and supporters gathered at a Seattle hotel declared victory after local media, including the Seattle Times, declared the measure had been approved.