She pledged to make “fighting Trump” her top priority. “I will use law as a sword, not just a shield,” she said. At one point, Ms. Teachout, who is pregnant, placed her hand on her abdomen and declared, “I feel the future growing inside me — and with every kick I feel more determined.”

Mr. Maloney’s candidacy could also have implications for the Democratic efforts to win the House.

If Mr. Maloney wins the attorney general primary on Sept. 13, he said he would step aside from his congressional re-election. He is one of just a dozen Democrats nationally who occupy a district that President Trump carried in 2016 (Mr. Trump won 49 percent there) — potentially opening a swing seat less than two months before the general election.

“I care intensely about keeping this seat in the blue column,” Mr. Maloney said.

In a truncated attorney general’s race, Mr. Maloney’s money, if he can use it, would make him formidable. His opponents would have to raise roughly $30,000 every day of the race just to equal the war chest that Mr. Maloney could begin with.

Election attorneys were split in interviews on whether he can transfer all those funds, with some believing federal committees can only transfer $1,000 to a state race.

“My understanding is we can spend almost all of it,” Mr. Maloney said of his war chest.

Then there is the question of running for two offices at once. Mr. Maloney believes he can do so, at least during the primaries. But tight election deadlines — including the timing in a law for sending ballots overseas — could complicate matters.

Joshua L. Oppenheimer, a top election lawyer in New York, said overlapping federal law, state law and court orders make the issue particularly complex. “There are too many novel legal questions,” he said. “If anyone gives you a slam-dunk answer, they’re leading you the wrong way.”

In fact, Representative Kathleen Rice, a Long Island Democrat who also had considered running for attorney general, cited “current state law prohibiting candidates from seeking two offices simultaneously” in her decision not to run last month.