The Pew Center poll released Thursday found that 72 percent of those surveyed think same-sex marriage will eventually become legal, an increase from 2004 when 59 percent, said gay marriage would become legal.

Broken down by party affiliation, the poll found 73 percent of Republicans said legalizing same-sex marriage is inevitable, with 72 percent of Democrats and 74 percent of independents agreeing.

Only 31 percent of Republicans, however, say they favor legalizing same-sex marriage. The poll also found that 59 percent of Democrats and 58 percent of independents, respectively, favor same-sex marriage.

The poll's findings come as a number of states seek to pass new laws legalizing gay marriage and the Supreme Court weighs challenges to a California law banning same-sex marriage and the federal Defense of Marriage Act.

The legislature in Illinois, President Obama's home state, last week narrowly failed to pass a measure legalizing same-sex marriage. The measure did not win enough support despite Obama himself expressing support for the proposal.

"And I just want to say for the record it's something that I deeply support," Obama said at a fundraiser in Chicago prior to the vote.

Obama is the first sitting president to publicly back same-sex marriage.

The poll was conducted from May 1-5 among 1,504 adults. The total sample size had a margin of error of plus or minus 3 points.