WASHINGTON — President Obama has balanced on a political tightrope for two years over the Defense of Marriage Act, the contentious 1996 law barring federal recognition of same-sex marriages. Now, two new federal lawsuits threaten to snap that rope out from under him.

Mr. Obama, whose political base includes many supporters of gay rights, has urged lawmakers to repeal the law. But at the same time, citing an executive-branch duty to defend acts of Congress, he has sent Justice Department lawyers into court to oppose suits seeking to strike the law down as unconstitutional.

The two lawsuits, however, have provoked an internal administration debate about how to sustain its have-it-both-ways stance, officials said. Unlike previous challenges, the new lawsuits were filed in districts covered by the appeals court in New York — one of the only circuits with no modern precedent saying how to evaluate claims that a law discriminates against gay people.

That means that the administration, for the first time, may be required to take a clear stand on politically explosive questions like whether gay men and lesbians have been unfairly stigmatized, are politically powerful, and can choose to change their sexual orientation.