Virginians are closely divided over whether gay marriage should be legal, according to a new Washington Post poll, a striking result in a state that overwhelmingly agreed to amend its constitution to ban gay marriage just five years ago.

Forty-seven percent of Virginians say gay couples should be allowed to legally wed, and 43 percent are opposed, according to the poll. Fifty-five percent of Virginians say gay couples should be able to legally adopt children.

The results mirror a dramatic and rapid shift in national public opinion about gay rights in recent years. The evolving public opinion could create a challenge in the key political battleground for the commonwealth’s Republicans, who are almost universally opposed to gay marriage, if voters think the GOP is falling out of sync with the electorate. But the results also present complications for Virginia Democrats, who have moved more slowly than their national counterparts to embrace liberal social stands for fear of alienating independent voters.

In 2006, 57 percent of voters agreed that Virginia should add language to the state constitution prohibiting marriage — or any approximation of the institution, including civil unions — between same-sex couples.

Changing the constitution in Virginia is cumbersome, requiring two votes by the General Assembly and a statewide referendum. The legislature, which overwhelmingly agreed to send the issue to voters in 2006, has shown no appetite to explore repealing it since.

Poll results are unlikely to prompt repeal, said advocates on both sides of the issue.

Claire Guthrie Gastanaga, a spokeswoman for the gay rights group Equality Virginia, said the political establishment’s views lag behind those of the public on the issue. “We knew that public opinion was evolving,” she said of opposition to the 2006 vote. “You end up leaving us in a posture where the public has moved and the policymakers haven’t and won’t.”

Victoria Cobb, president of the Family Foundation of Virginia, countered that Virginians speak more clearly at the ballot box than in polls.

“Typically, people elect the officials they want to implement the policy they believe in,” she said, noting that despite shifting poll results, voters in 31 states have agreed to prohibit same-sex marriage.

The views contrast with those on another hot-button social issue: abortion. Opinions on abortion in Virginia have remained similar in recent years. Fifty-three percent of Virginians say abortion should be legal in all or most cases; 40 percent say it should be illegal in all or most instances.

No matter where Virginians come down on gay marriage this year, views on the subject tend to be strongly held: About two-thirds of Virginians feel “strongly” on one side or the other. About 30 percent of all Virginians “strongly” support gay marriage, and 35 percent oppose it just as adamantly.

The Post poll numbers on gay marriage also reflect a big age gap, with broad support of gay rights among young adults potentially shaping policy on the issue for years to come.

The survey shows that nearly three-quarters of those ages 18 to 29 say gays should be able to legally wed. Only 22 percent of those ages 65 and older agree. Between the ages of 30 and 65, residents are split, with 44 percent saying same-sex marriage should be legal and 43 percent saying it should illegal.

Those results suggest a possible shift in recent years, even among young people. Exit polling conducted after the 2006 vote to amend the constitution indicated that a majority of voters in every age group supported the proposal.

Howard Racsid, 47, a retired Internet consultant from Fredericksburg, said that just a few years ago he opposed gay marriage. But he said his views have changed. Despite feeling uncomfortable with the notion, he says gays should be able to legally marry and adopt.

“My overarching theme is equal rights for everyone, and within that context, I have to support it,” he said. “It’s funny, life, as you go along, things aren’t always what they seemed even a year ago.”

The poll also indicates that majorities of Democrats (56 percent) and independents (53 percent) favor gay marriage, but 60 percent of Republicans are opposed.

Chris Mason, 43, an auto dealership employee who lives in Winchester, said his opposition to gay marriage is based on his belief in the traditional family structure.

But he said he agrees with gay couples receiving new recognition under the law.

“I am totally fine with homosexual couples having a civil union in which they’re recognized as a couple and have every legal right — but it should never be called marriage,” he said. “Words have meaning.”

The poll also finds that 35 percent of Virginians say it should be illegal for gay couples to adopt. Virginia is one of 34 states where only married couples and single adults, whether gay or straight, can adopt. Virginia law bars adoptions by all unmarried couples, regardless of sexual orientation. And some private adoption agencies, including religious institutions, have their own rules regarding gay adoptions by single people.

Despite emotional pleas from gay-rights groups, the State Board of Social Services, which regulates adoptions in Virginia, recently declined to bar discrimination on the basis of sexual orientation by adoption agencies.

Virginia’s shift on gay marriage reflects the nation’s. In 2006, nearly six in 10 Americans opposed same-sex marriage, but by spring of this year, a majority for the first time supported it. A mid-March Post-ABC News poll found support for gay marriage at 53 percent nationally.

The survey also reflects strong regional differences on same-sex marriage. In the D.C. suburbs, 64 percent support gay marriage. Elsewhere in the state, that number falls to 43 percent.

In contrast to four years ago, about as many Virginians consider themselves to be liberal on social matters as call themselves conservative. Fiscal conservatism is on the rise, but on these social issues, it’s liberalism that’s ticked higher.

The poll was conducted by conventional phones and cellphones from April 28 to May 4 and included interviews with 1,180 adults. The full poll has a margin of sampling error of plus or minus 3.5 percentage points.

Polling manager Peyton M. Craighill contributed to this report.