As she sought Monday to quell persistent questions about her distant Native American ancestry, Sen. Elizabeth Warren also raised an important new one: Just how much is President Trump driving the Democratic presidential contest?

The Warren issue, a response to Trump’s relentless attacks on the Massachusetts Democrat, illustrated the tricky task facing Democrats as the 2018 midterms near and soon are followed by the 2020 presidential contest: how to respond to the roiling debates within their own party and also to the bomb-thrower in the Oval Office.

Even as many Democrats would like to focus on 2018 candidates, Warren was pushed by Trump to release a DNA test about her heritage. Michael Avenatti, who rose to national fame as Trump accuser Stormy Daniels’s attorney and now is toying with a presidential run, showcases a near-daily engagement with Trump, one that appeared to backfire when he aired unsubstantiated accusations against now-Supreme Court Justice Brett M. Kavanaugh. Former vice president Joe Biden, another potential presidential aspirant, has been counterprogramming in the same places as Trump, holding rallies in Kentucky last week and Nevada this week to respond to the president.

All of that has given the appearance that Trump, and not his would-be challengers, is setting the tone of the current debate, defining what topics his political rivals react to and distracting from more-pressing Democratic needs.

Warren, for her part, is working aggressively to elect candidates around the country — dispatching staffers to nine states and closely coordinating with more than 150 campaigns. But her announcement Monday seemed to shift focus from that field of play.

“Argue the substance all you want, but why 22 days before a crucial election where we MUST win house and senate to save America, why did @SenWarren have to do her announcement now?” tweeted Jim Messina, the campaign manager for Barack Obama’s 2012 campaign. “Why can’t Dems ever stay focused???”

A Warren aide said that her campaign received the DNA report Oct. 10 and decided to release it as soon as possible. It showed that Warren had a Native American ancestor between six and 10 generations ago.

Warren’s announcement Monday was an effort to reclaim control over her life story, one that had been caricatured and reduced to a single nickname — “Pocahontas” — that Trump amplified in response to since-disproven allegations that her hiring at Harvard Law School was due to her claim to Native American heritage.

The president mocked her relentlessly, ignoring criticism from Native Americans and others that his language was racist and insulting, and proposed that she take a DNA test.

Both Trump and Warren engaged in a tit-for-tat all day Monday.

Warren, after releasing the results of her test, aimed a barrage of tweets at him, touting the results (“I don’t take any fight lying down”), demanding that he release his tax returns (“What are YOU hiding . . . Tick-tock, Mr. President”) and suggesting he has a memory problem (“Should we call for a doctor?”).

Warren also challenged him to live up to his pledge to donate $1 million if she took a DNA test. Trump alternately seemed to ignore her and change the terms of the deal.

His initial response, after she released the test, was simple:

“So what?” he asked.

Later, while stopping at an American Red Cross facility amid a tour of hurricane damage in Georgia, Trump added: “I’ll only do it if I can test her personally, and that will not be something I will enjoy doing either.”

Warren also got grief from another side. Late Monday, the leader of the Cherokee Nation in Oklahoma issued a blistering statement, criticizing Warren for taking a DNA test in the first place.

“Using a DNA test to lay claim to any connection to the Cherokee Nation or any tribal nation, even vaguely, is inappropriate and wrong,” Cherokee Nation Secretary of State Chuck Hoskin Jr. said in a statement. “It makes a mockery out of DNA tests and its legitimate uses while also dishonoring legitimate tribal governments and their citizens, whose ancestors are well documented and whose heritage is proven.”

“Senator Warren is undermining tribal interests with her continued claims of tribal heritage,” Hoskin said.

As she nears a public announcement of a presidential campaign, one that she has said she will seriously consider after the election, Warren was also seeking to draw a further distinction between herself and the president.

Trump hasn’t released any of his tax returns, and Warren recently released 10 years of hers. He’s never released any of his college transcripts, but Warren recently provided a batch of her personnel files to show that her claims of Native American heritage were not a factor in gaining law professorships at elite universities.

The release from Warren was also an attempt to make up for a misstep during her 2012 U.S. Senate campaign, when her advisers were caught flat-footed as her opponent, then-Sen. Scott Brown (R-Mass.), raised questions about her claims of Native American heritage.

As a pure political exercise, the Warren release Monday demonstrated the lengths she is willing to go to remove any rocks strewn in her path to a presidential bid.

Her campaign published a fact-checking website. It released a five-minute video. It provided the six-page DNA test, the results of which were first published by the Boston Globe.

The video — produced by the Warren campaign’s digital team — was slickly produced and included extensive interviews, illustrating the preparation ahead of the announcement.

It featured interviews with 18 people, including her three older brothers, self-professed conservatives who live in Oklahoma and called Trump’s criticisms “ridiculous” and “silly.”

In it Warren retold the story of hearing that the maternal side of her family had Native American blood, a circumstance that she said led to conflict with her father’s family. It showed a video of her hearing the results of the DNA test from Carlos D. Bustamante, a Stanford University professor who analyzed the results and determined there was “strong evidence” that she had a Native American ancestor.

“My parents were real people. The love they shared, the struggles they endured, the family they built, the story they lived will always be on my heart,” Warren said in the video. “And no one, not even the president of the United States, will ever take it away from me.”

Republicans immediately pounced.

“President Trump has a real knack for getting Democrats to do dumb things,” said Ari Fleischer, a Republican consultant and former aide to President George W. Bush. “I suspect in a 20-person Democratic primary, the race to get attention, to differentiate yourself as a candidate, will revolve around who can be the toughest on Trump, which will likely spell itself out in foolish ways. This is part and parcel of that.”

“The issue with Donald Trump is people fight back at his level, and unless your personality is really like Donald Trump’s, that just doesn’t work,” he added. “They’re trying to be mini-Trumps. And it’s going to backfire.”

But a Democratic counterpart, longtime strategist and Obama pollster Joel Benenson, suggested that punching back at Trump was a key part of the deal for any Democratic candidate for president. Trump’s needling of Warren, he suggested, exposed the president’s fear of the senator, who even before Monday had made no secret of her intent to fight back hard against the president.

“Trump, whether we like it or not, will hang over a lot of the primary season. He hangs like a dark cloud over so much of what’s going on,” Benenson said.

“But he spends an inordinate amount of time on Elizabeth Warren, and it’s clear she gets under his skin,” he added. “Tough-guy Trump shows he’s got a real weakness here.”