Mr. Romney has said that he favors allowing domestic partnerships that bestow certain rights on same-sex couples, like hospital visitation, but he has not delineated them in great detail.

“Benefits of that nature may well be appropriate, and states are able to make a provision for the determination of those kinds of rights,” Mr. Romney said Wednesday.

Republicans and Democrats, in their reactions to the president’s support for same-sex marriage, said they saw a newly wide, and seemingly unbridgeable, gap between the two leaders on the issue.

“We now have a clear choice between Romney and Obama,” said Maggie Gallagher, a founder of the National Organization for Marriage, which opposes same-sex marriage. She called the president’s decision “a huge mistake” that would reward the Republican Party.

Evan Wolfson, the founder of Freedom to Marry, a gay rights organization, said that now “there is absolutely no way that opponents of gay rights can hide behind any unclarity in the president’s position and make the bogus claim that it’s the same as theirs.”

Mr. Romney has, over the years, made it clear that his opposition to same-sex marriage and civil unions is a deeply held moral conviction, and he has not shied from using strong language to describe the offense he has taken to its introduction.

When in 2003 the Massachusetts courts legalized same-sex marriage in the state, Mr. Romney, then governor, complained that the state had become “San Francisco East.” And, speaking with a sense of alarm about gay couples, he warned a conservative audience that “some are actually having children born to them.”