Barbara McKeefery, left, and Chris Megargee of Kent Island, Md., have been together for 24 years. (Linda Davidson/THE WASHINGTON POST)

The number of people who identify themselves as part of a same-sex couple has soared over the past decade in what demographers say is the product of an aggressive outreach effort by the Census Bureau and growing cultural acceptance.

Census figures released Thursday show 17,000 same-sex couples live in Maryland, a 51 percent increase over a decade ago. That accounts for 1.5 percent of couples in the state, including married couples and heterosexual partners living together.

In Virginia, the census counted 20,500 same-sex couples, a 49 percent increase that amounts to 1.2 percent of couples in the state.

In both states, the number of heterosexual married couples increased only modestly.

The census did not ask people for their sexual orientation, but people were asked about their relationships.

In 1990, when the census added unmarried partner as an option but gave no instructions, relatively few same-sex couples checked it. The number went up slightly in 2000. Then, in the 2010 , the agency formed partnerships with gay and lesbian groups to help encourage people to correctly categorize their relationship and to assure them that information provided to the census is confidential.

As a result, demographers don’t think the actual number of gay couples has increased as dramatically as the numbers suggest. Rather, it reflects more same-sex couples being honest about who they are.

“The bulk of the change is people acknowledging it,” said Gary Gates, a demographer with the Williams Institute, a UCLA think tank that specializes in gay legal and policy issues. “Indicating your relationship on a census form is one way of suggesting people are more open about it. But it doesn’t necessarily mean they’re terribly out in their community.”

In Maryland and Virginia, most of the same-sex couples live in urban neighborhoods. Baltimore and Richmond show the highest levels, and the Washington suburbs are close behind. In some Baltimore neighborhoods, as many as 14 percent of couples are gay and lesbian.

Near Washington, the biggest percentages of gay and lesbian couples are in neighborhoods around Takoma Park, Rosslyn, College Park, Cheverly and parts of Alexandria. The Alexandria Gay and Lesbian Community Association, for example, is so active in civic affairs that it hosts an annual barbecue for the city’s firefighters, police and EMTs.

The census shows that gay and lesbian couples are present in every county in both states. And gay families with minor children were counted in every jurisdiction except for one sparsely-populated Virginia county near the West Virginia border.

Though their numbers are smaller, gay and lesbian couples with children show up at higher rates in many rural areas. Gates said that is because many of them had an earlier relationship and child with someone of the opposite sex.

David Reilly, left, Chelsea Stemple and Stephen Reilly are the children of gay couple Barbara McKeefery and Chris Megargee. Stemple is Megargee’s daughter, and the men are McKeefery’s sons. (Courtesy Chris Megargee and Barb McKeefery )

“It’s more common in socially conservative areas where people tend to come out later,” he said. “The irony is that socially conservative areas create more gay families.”

As gay couples are more frank about their relationships, society at large is becoming more accepting of homosexuals.

Chris Megargee and Barbara McKeefery, who have been together for 24 years and are now grandmothers, said they have always been treated warmly by their neighbors, both in Cape St. Clair outside Annapolis, where they raised two boys, and on Kent Island, where they now live.

“We were the first gay people most of them had ever met in person,” said McKeefery, 59, an optician.

“We live a golden life,” said Megargee, 58, who runs a promotions company from her home. “Among the people we deal with in our daily lives — our families, at work and in our neighborhood — we are treated just like anyone else in modern-day America. We are very open about who we are, and we have no issues or concerns whatsoever.”

Tony Curtis and his partner, Dan Dycus, have lived for eight years in Accokeek in Prince George’s County, where black church leaders fought vigorously against a statewide same-sex marriage bill that was defeated. According to the census data, Curtis and Dycus are among almost 2,500 same-sex couples in Prince George’s County — almost as many as the larger Montgomery County.

Almost all of the residents in the development where they live on a cul de sac are African American, and Dycus, who is white, became president of the homeowners association a few years ago.

“Everyone has been so nice to us,” said Curtis, 47, who heads a company in the commercial real estate industry. “I’m not sure if it reflects how they feel about us. But we’ve never had a problem with any of our neighbors.”

District figures will be released next week.

Sociologists think that most gay couples decide where to live depending on factors that have nothing to do with laws and politics.

“We’re not any different than a straight couple,” said Cary Jagur, president of the Alexandria Gay and Lesbian Community Association. “We live where we can afford, where it’s reasonable to work, where there are good schools if you have children and where it’s close to shopping amenities. All the things our parents looked for.”

But Alison Page and her partner, Leanne Wells, left Virginia when they moved from Centreville to Laurel in 2004 after they decided to have children. Paige gave birth to twins in 2006, and Wells adopted them.

“We knew we wanted to have children, so we moved before we started the process,” said Page, 37. “The state of Virginia would not allow second-parent adoptions for same-sex couples. Maryland gave us the legal protection we needed. We’ll probably move within five years, and probably within Maryland.”

Maryland’s census numbers were seized on by both opponents and supporters of same-sex marriage, who are planning another push in next year’s legislative session, this time with assistance from Gov. Martin O’Malley (D).

Del. Michael J. Hough (R-Frederick) said the numbers reinforce one of the arguments he and other opponents of same-sex marriage have been making.

“We’re talking about radically redefining marriage for what is a very, very small subset,” he said.

State Sen. Richard S. Madaleno Jr. (D-Montgomery), an openly gay man raising two children with his partner, said the statistics show how many people might choose to marry if it becomes legal.

“It demonstrates that there are a significant number of same-gender families in our state, and we are everywhere in the state,” he said. “It also shows that in the end, we’re not talking about a lot of people. The other side’s predictions of doom and gloom are oversized.”

Del. Heather R. Mizeur (D-Montgomery), a gay lawmaker who has a wife, said the census numbers show the changing face of what is now considered family.

“There are 9,000 Maryland children that have two moms or two dads, that are looking to the General Assembly and saying, ‘Protect my family, like everyone else’s,’ ” she said.

Staff Writer John Wagner contributed to this report.