A majority of justices raised questions in oral arguments Wednesday about the federal Defense of Marriage Act, indicating the Supreme Court may strike down a key part of the law that denies legally married same-sex couples the same benefits provided to heterosexual spouses.

A ruling is expected within three months on the constitutionality of the 1996 law that defines marriage for federal purposes as only between one man and one woman.

Wednesday's arguments concluded two days of presentations before the high court on one of the most prevalent social issues of this era -- the right of gay and lesbian couples to wed and receive the full benefits of law provided to heterosexual couples.

Afterward, Edith "Edie" Windsor, 83, stood on the steps of the courthouse -- near the "Equal Justice Under Law" slogan engraved above -- and proclaimed something she hid for decades before her challenge against the act known as DOMA.

"I am today an out lesbian, OK, who just sued the United States of America, which is kind of overwhelming for me," she said. She had just watched almost two hours of oral arguments before the nation's highest court on how she had to pay higher estate taxes than someone in a heterosexual marriage.

Windsor tried to explain to reporters why she and her late spouse, Thea Spyer, married in New York when the law allowed it after decades together.

Marriage, she said, is "a magic word, for anyone who doesn't understand why we want it and why we need it."

"We did win in the lower court," Windsor added, then later predicted: "I think it's gonna be good."

Under DOMA, Social Security, pension and bankruptcy benefits, along with family medical leave protections and other federal provisions, do not apply to gay and lesbian couples legally married in states that recognize such unions.

Windsor was forced to assume an estate tax bill much larger than heterosexual married couples would have to pay. Because her decades-long partner was a woman, the federal government did not recognize their same-sex marriage in legal terms, even though their home state of New York did.

Photos:Photos: Outside the Supreme Court

Photos:Photos: Outside the Supreme Court

Outside the Supreme Court – Supporters of same-sex marriage wave flags and signs as they rally in front of the U.S. Supreme Court on Wednesday, March 27, in Washington. The justices heard two cases this week related to state and federal laws restricting same-sex marriage.

Hide Caption

1 of 22

Photos:Photos: Outside the Supreme Court

Outside the Supreme Court – One case involves plaintiff Edith "Edie" Windsor, right, who was forced to assume an estate tax bill much larger than married heterosexual couples would have to pay after her decades-long same-sex partner died. The federal government did not recognize Windsor's marriage in legal terms, even though her home state of New York did. Here, she leaves the courthouse after watching arguments over the constitutionality of the Defense of Marriage Act.

MUST WATCH

JUST WATCHED

Same-sex marriage 'too new' for court?

MUST WATCH

The court appeared divided along ideological lines during the arguments about whether DOMA is discriminatory and steps on state marriage laws for gays and lesbians.

If legally married homosexuals were being denied more than 1,100 federal benefits, "what kind of marriage is that?" asked Justice Ruth Bader Ginsburg, who said the discriminatory effect is "pervasive."

"What gives the federal government the right to define marriage?" asked Justice Sonia Sotomayor.

The potential swing vote, Justice Anthony Kennedy, also questioned the reach of DOMA, saying it presents a "real risk of running into traditional state police power to regulate marriage."

Kennedy's point caused court observers to speculate he would join the four normally liberal-leaning justices to create a majority against the act.

On the other side, Chief Justice John Roberts repeatedly asked whether it would step on state power to do the opposite of DOMA -- pass a law providing full federal benefits to any legally married same-sex couple.

When Windsor's lawyer argued in court there was a "sea change" afoot today in support of same-sex marriage that leaves DOMA outdated, Roberts said that is because of "the political effectiveness of those on your side" swaying public opinion.

Roberts and Justice Antonin Scalia also suggested DOMA could still remain in place as a valid extension of congressional authority, as 41 states do not allow same-sex marriage.

Paul Clement, the high-profile lawyer hired by House Speaker John Boehner and fellow Republican legislators to defend DOMA, suggested the act was passed as a "cautious approach" in response to initial efforts in some states to change state marriage laws to include homosexuals.

"In 1996 something was happening" in the country, Clement said, adding that Congress wanted to created uniformity in the federal sphere and not sow confusion in states that did not want same-sex marriage.

Photos:Photos: Same-sex marriage at a crossroads

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Supporters of same-sex marriage gather in front of the U.S. Supreme Court on Tuesday, March 26, in Washington. The justices heard arguments on California's Proposition 8, which bans same-sex marriage. Dozens of people camped out in hopes of attending the hearing, and rallies in support of same-sex marriage have been held throughout the country.

Hide Caption

1 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Colorful beach chairs lined up by demonstrators sit in front of the U.S. Supreme Court on Monday, March 25, in Washington.

Hide Caption

2 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Supporters of same-sex marriage hold signs during a rally in support of marriage equality on March 25 in San Francisco.

Hide Caption

3 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Nikolas Lemos waves a rainbow flag during the March 25 rally in San Francisco.

Hide Caption

4 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Trey Allen yells into a bullhorn during the rally in San Francisco.

Hide Caption

5 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Ken Mauldin, left, hugs Larry Davanzo during the demonstration in San Francisco.

Hide Caption

6 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – A supporter of same-sex marriage passes out stickers in San Francisco.

Hide Caption

7 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Demonstrators carry flags through the streets of Chicago on March 25.

Hide Caption

8 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Gay rights activists gather on March 25 in Chicago.

Hide Caption

9 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – Marriage equality supporters take part in a march in New York on Sunday, March 24.

Hide Caption

10 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – People move through the demonstration in New York on March 24.

Hide Caption

11 of 12

Photos:Photos: Same-sex marriage at a crossroads

Same-sex marriage at a crossroads – People rest in front of the Supreme Court in Washington on March 24 in the line for the hearing.

Hide Caption

12 of 12

However, Justice Elena Kagan drew an audible gasp from the packed courtroom by quoting from the official House reports of 17 years ago, when legislators stated one reason to pass DOMA was to "express moral disapproval" over gays and lesbians being allowed to wed.

It was not until 2004 that Massachusetts became the first state to legalize same-sex marriage.

No consensus was reached from the bench on the gateway or jurisdictional questions -- whether House Republicans were on solid legal footing when they stepped in and defended the law after President Barack Obama and his Justice Department reversed their position by concluding DOMA was unconstitutional.

The administration changed its mind after initially defending the law before a federal judge hearing the Windsor lawsuit.

Roberts tweaked Obama for not having "the courage of conviction" to continue enforcing the law even if he thought it was discriminatory.

At a news conference later Wednesday, House Democratic leader Nancy Pelosi of California called congressional Republicans irresponsible for funding the defense of what she called a discriminatory law at a cost she put at $3 million.

"On the basis of what I heard, the questions of the justices, the response of the participants, I'm very optimistic that DOMA will be struck down," Pelosi said.

To Windsor, Wednesday's arguments represented another step in the evolving history of gay rights in America.

For years, she said, she wore a circle of diamonds as a pin instead of a traditional diamond ring to hide her lesbian relationship from co-workers.

Photos:Same-sex marriage in the U.S.

Photos:Same-sex marriage in the U.S.

Carlos McKnight of Washington waves a flag in support of same-sex marriage outside the U.S. Supreme Court on June 26, 2015. The Supreme Court ruled 5-4 that states cannot ban same-sex marriage, handing gay rights advocates their biggest victory yet. See photos from states that approved same-sex marriage before the nationwide ruling:

Hide Caption

1 of 33

Photos:Same-sex marriage in the U.S.

Shante Wolfe, left, and Tori Sisson become the first same-sex couple to file their marriage license in Montgomery, Alabama, on February 9, 2015. However, seven months after the U.S. Supreme Court ruling legalizing such nuptials nationwide, Alabama Chief Justice Roy Moore directed probate judges in his state to enforce the ban on same-sex marriage. Gay rights organizations swiftly denounced Moore's January 6, 2016, order.

Hide Caption

2 of 33

Photos:Same-sex marriage in the U.S.

Newlyweds Jeff Delmay and Todd Delmay hug during a marriage ceremony in a Miami courtroom January 5, 2015. Florida began allowing same-sex marriages after a federal judge struck down the state's ban.

Hide Caption

3 of 33

Photos:Same-sex marriage in the U.S.

Chad Biggs, left, and Chris Creech say their wedding vows at the Wake County Courthouse in Raleigh, North Carolina, on October 10, 2014, after a federal judge ruled that same-sex marriage can begin in the state.

From left, plaintiffs Moudi Sbeity; his partner, Derek Kitchen; Kody Partridge; and Partridge's wife, Laurie Wood, celebrate after a news conference in Salt Lake City on October 6, 2014. The U.S. Supreme Court cleared the way for same-sex marriage in Utah when it declined to hear the state's appeal of a lower court ruling.

Hide Caption

6 of 33

Photos:Same-sex marriage in the U.S.

Abbi Huber, left, and Talia Frolkis exit the City County Building in Madison, Wisconsin, after applying for a marriage license on October 6, 2014.

Hide Caption

7 of 33

Photos:Same-sex marriage in the U.S.

Rob MacPherson, right, and his husband, Steven Stolen, hug during a news conference at the American Civil Liberties Union in Indianapolis on October 6, 2014.

Hide Caption

8 of 33

Photos:Same-sex marriage in the U.S.

Mary Bishop, second from left, and Sharon Baldwin, right, celebrate with family and friends following their wedding ceremony on the courthouse steps in Tulsa, Oklahoma, on October 6, 2014.

Hide Caption

9 of 33

Photos:Same-sex marriage in the U.S.

Jennifer Melsop, left, and Erika Turner kiss after they were married in front of the Arlington County Courthouse in Arlington, Virginia, on October 6, 2014.

Hide Caption

10 of 33

Photos:Same-sex marriage in the U.S.

Pastor Carol Hill from Epworth United Methodist Church speaks during a marriage-equality ceremony at the Kathy Osterman Beach in Chicago on June 1, 2014. The date marked the first day that all of Illinois' 102 counties could begin issuing marriage licenses to same-sex couples.

Hide Caption

11 of 33

Photos:Same-sex marriage in the U.S.

William Roletter, left, and Paul Rowe get close after having their photo taken with their marriage certificate May 21, 2014, at Philadelphia City Hall.

Hide Caption

12 of 33

Photos:Same-sex marriage in the U.S.

Julie Engbloom, left, and Laurie Brown embrace after marrying in Portland, Oregon, on May 19, 2014. A federal judge struck down the state's voter-approved ban on same-sex marriage.

Hide Caption

13 of 33

Photos:Same-sex marriage in the U.S.

Jennifer Rambo, right, kisses her Kristin Seaton after their marriage ceremony in front of the Carroll County Courthouse in Eureka Springs, Arkansas, on May 10, 2014. Rambo and Seaton were the first same-sex couple to be granted a marriage license in Eureka Springs after a judge overturned Amendment 83, which banned same-sex marriage in Arkansas.

Hide Caption

14 of 33

Photos:Same-sex marriage in the U.S.

Same-sex couples get their marriage licenses at the Oakland County Courthouse in Pontiac, Michigan, on March 22, 2014, a day after a federal judge overturned Michigan's ban on same-sex marriage.

Hide Caption

15 of 33

Photos:Same-sex marriage in the U.S.

On November 13, 2013, Hawaii Gov. Neil Abercrombie, left, and former state Sen. Avery Chumbley celebrate with a copy of the Honolulu Star-Advertiser after Abercrombie signed a bill legalizing same-sex marriage in the state.

Hide Caption

16 of 33

Photos:Same-sex marriage in the U.S.

Utah state Sen. Jim Dabakis, left, and Stephen Justesen acknowledge the crowd after being married in Salt Lake City in December 20, 2013.

On October 21, 2013, Cory Booker, right, officiates a wedding ceremony for Joseph Panessidi, center, and Orville Bell at the Newark, New Jersey, City Hall. The New Jersey Supreme Court denied the state's request to prevent same-sex marriages temporarily, clearing the way for same-sex couples to marry.

Hide Caption

19 of 33

Photos:Same-sex marriage in the U.S.

A couple celebrates at San Francisco City Hall upon hearing about the U.S. Supreme Court rulings on same-sex marriage on June 26, 2013. The high court cleared the way for same-sex couples in California to resume marrying after dismissing an appeal on Proposition 8 on jurisdictional grounds. The court also struck down a key part of the Defense of Marriage Act, a 1996 federal law defining marriage as between a man and a woman.

Hide Caption

20 of 33

Photos:Same-sex marriage in the U.S.

At the state Capitol in St. Paul, Minnesota, Gov. Mark Dayton signs a bill legalizing same-sex marriage on May 14, 2013.

Hide Caption

21 of 33

Photos:Same-sex marriage in the U.S.

Delaware Gov. Jack Markell holds up legislation on May 7, 2013, allowing same-sex couples to wed in the state.

Hide Caption

22 of 33

Photos:Same-sex marriage in the U.S.

Rhode Island state Sen. Donna Nesselbush, right, embraces a supporter after the Marriage Equality Act was signed into law at the statehouse in Providence on May 2, 2013.

Hide Caption

23 of 33

Photos:Same-sex marriage in the U.S.

Jamous Lizotte, right, and Steven Jones pose for photos while waiting for a marriage license in Portland, Maine, on December 29, 2012.

Hide Caption

24 of 33

Photos:Same-sex marriage in the U.S.

On March 1, 2012, Maryland Gov. Martin O'Malley, center, shakes hands with Senate President Thomas V. "Mike" Miller after signing a same-sex marriage bill. The law was challenged, but voters approved marriage equality in a November 2012 referendum.

Hide Caption

25 of 33

Photos:Same-sex marriage in the U.S.

On February 13, 2012, Washington Gov. Chris Gregoire celebrates after signing marriage-equality legislation into law. Voters there approved same-sex marriage in November 2012, defeating a challenge by opponents.

Hide Caption

26 of 33

Photos:Same-sex marriage in the U.S.

Phyllis Siegel, right, kisses her wife, Connie Kopelov, after exchanging vows at the Manhattan City Clerk's office on July 24, 2011, the first day New York's Marriage Equality Act went into effect.

Hide Caption

27 of 33

Photos:Same-sex marriage in the U.S.

On August 21, 2010, TV reporter Roby Chavez, right, shares a moment with gay rights activist Frank Kameny during Chavez and Chris Roe's wedding ceremony in the nation's capital. Same-sex marriage became legal in Washington in March 2010.

Hide Caption

28 of 33

Photos:Same-sex marriage in the U.S.

Olin Burkhart, left, and Carl Burkhart kiss on the steps of the New Hampshire Capitol on January 1, 2010, after the state's law allowing same-sex marriage went into effect.

Hide Caption

29 of 33

Photos:Same-sex marriage in the U.S.

In May 2009, Maine state Sen. Dennis Damon, left, hands Gov. John Baldacci the bill that the state Senate passed to affirm the right of same-sex couples to marry.

Hide Caption

30 of 33

Photos:Same-sex marriage in the U.S.

Amy Klein-Matheny, left, and her wife, Jennifer, exchange vows in Iowa after same-sex couples were allowed to marry there with an April 3, 2009, court ruling.

Hide Caption

31 of 33

Photos:Same-sex marriage in the U.S.

Michael Miller, left, and Ross Zachs marry on the West Hartford Town Hall steps after same-sex marriage became legal in Connecticut on November 12, 2008.

Hide Caption

32 of 33

Photos:Same-sex marriage in the U.S.

Lara Ramsey, left, and Jane Lohmann play with their 7-month-old son, Wyatt Ramsey-Lohmann. The two wed in 2004 after Massachusetts approved same-sex marriage. Massachusetts was the first state to do so.

"We all lived, really, behind masks and in closets, indeed," Windsor explained. "So what happened is there was, as we increasingly came out, people saw that we didn't have horns. People learned that, okay, we were their kids and their cousins and their friends, all of whom were coming out for the first time. And I think it just, it just grew to where we were human beings like everybody else. And I really think that's what made the change."

Laughing, she told reporters: "I'm talking to you freely. I'd have been hiding in a closet 10 years ago."

JUST WATCHED

Same-sex marriage dividing GOP

MUST WATCH

JUST WATCHED

Fighting to redefine marriage

MUST WATCH

Fighting to redefine marriage04:57

Public interest remained high outside the court in advance of Wednesday's session, but not at the same level as Tuesday's arguments in another case involving California's voter-approved ban of same-sex marriage.

A smaller crowd gathered than the day before, with most of them opponents of DOMA.

"I'm here today because I'm a social worker and I've seen a lot of people suffer over the years," Mary Ann Piet told CNN. "And I'm concerned about not getting people their human rights, their dignity as people."

Conservative supporters of the law contend it codifies a fundamental cornerstone of society, and changing the definition of marriage would have widespread negative impacts.

During Tuesday's arguments, the justices seemed to lack consensus on both jurisdictional and constitutional questions relating to the voter-approved California law, known as Proposition 8, which bans same-sex marriage.

The overriding legal question in the California case is whether the Constitution's guarantee of equal protection under the law prevents states from refusing marriage to a defined class of people.

When it rules, the court could strike down laws across the country banning same-sex marriage, or it could leave the current patchwork of state laws in place, choosing to let state legislatures and state courts sort it all out.

"This was a deeply divided Supreme Court, and a court that seemed almost to be groping for an answer here," CNN Senior Legal Analyst Jeffrey Toobin said after the arguments.

Four of the more liberal justices seemed at least open to the idea that same-sex marriage should be allowed in California. Three of the more conservative justices seemed aligned with the view that marriage should only be for a man and a woman, and it's likely they'd be joined by Justice Clarence Thomas, who doesn't speak at arguments.

That could leave Kennedy as the swing vote, as has often been the case.

While admitting the law's defenders are "not just any citizens," Kennedy raised concerns about whether just the possibility of same-sex marriage was enough to establish they had suffered harm -- a key jurisdictional hurdle allowing them to appeal in the first place.

Among the 41 states that now forbid same-sex marriage, nine of them allow civil partnerships. Nine other states allow same-sex marriage, and about 120,000 same-sex couples have gotten married, according to estimates.

Prohibitions seem to run counter to polls that show rising support overall for same-sex marriage.

A CNN/ORC International poll released on Monday found 53% of Americans now support same-sex marriage, up from 40% in 2007. As to how the federal government should handle the issue, another CNN/ORC International poll out Tuesday found 56% of the public feels the federal government should also legally recognize same-sex marriages.