WASHINGTON — Senate moderates reached a bipartisan agreement Wednesday aimed at balancing Democrats’ fight to offer citizenship to young “Dreamer” immigrants with President Donald Trump’s demands for billions of dollars to build his coveted border wall with Mexico, participants in those talks said.

It was unclear how the compromise would be greeted by Republican and Democratic leaders or the White House, or whether it could attract the 60 votes that will be needed to move through the closely-divided Senate. So far, no other package has emerged from either side that seems able to do that, leaving the debate’s outcome in doubt.

The proposal was emerging as the Senate spent a third day of debate largely as it’s spent the first two — with the chamber floor mostly empty. Other than an initial roll call allowing formal debate to begin, there have been no other votes while party leaders talk behind the scenes about scheduling votes on specific proposals.

Senate Majority Leader Mitch McConnell, R-Ky., has said he wants the Senate to finish considering immigration legislation this week. It is unclear whether that will happen.

Sen. Lindsey Graham, R-S.C., said the moderates’ proposal would grant a 10- to 12-year route to citizenship for 1.8 million Dreamers, the same number Trump has suggested in his own wider-ranging proposal. Dreamers are young immigrants who were brought to the U.S. illegally as children and still have no permanent protection from deportation.

Graham and Sen. Mike Rounds, R-S.D., said the plan would provide $25 billion over a decade for a wall and other border security measures, an amount Trump has requested. It would bar Dreamers from sponsoring their parents for citizenship — well short of a Trump proposal to prevent all legal immigrants from bringing parents and siblings to the U.S.

The moderates’ measure does not end a lottery that distributes about 55,000 visas annually to people from diverse countries, as Trump has proposed.

“The diversity lottery is kind of toxic politically because of some of the things said by the president made that really hard politics on the Democratic side,” said Graham, a reference to a vulgar description Trump used for people from African countries.

The White House issued a written statement by Trump urging senators to back and his bill and “oppose any legislation that fails to fulfill” his “four pillars.” But the statement did not say Trump would veto a bill that fell short of his demands.

A GOP bill tracking Trump’s proposal and backed by McConnell has been introduced and could receive a Senate vote soon.

Few expect Trump’s plan to attract the 60 votes it would need to survive, but Rounds said he believed the moderates’ proposal could.

If that happens, Rounds said, “We’ll allow the president to determine whether or not it moves in the direction that he wants.”

Also in play is a more modest plan by Sens. John McCain, R-Ariz., and Chris Coons, D-Del., and supported by Senate Minority Leader Chuck Schumer, D-N.Y. It would let many Dreamers qualify for permanent residence and direct federal agencies to more effectively control the border by 2020. But it doesn’t offer a special citizenship pathway for Dreamers or make sweeping changes in legal immigration rules.

In another statement, the White House said it opposes the McCain-Coons plan. It said the proposal would “increase illegal immigration, surge chain migration” — a term critics use to describe family-based immigration — and cause other problems.

Democrats prefer a narrower approach that addresses “Dreamers” and border security. Schumer said that “the one person who seems most intent on not getting a deal is President Trump.” He said Trump “is trying to force his unpopular, hard-line immigration agenda down the throats of the American people.”

McConnell said the president has “spelled out a fair and generous framework that will be necessary to earn his signature.”

Associated Press writer Andrew Taylor contributed to this report.