WASHINGTON—Democratic congressional leaders said President Trump agreed to aim for a $2 trillion infrastructure package in a White House meeting on Tuesday, though the two sides didn’t discuss how it would be paid for, and Capitol Hill Republicans are unlikely to go along.

“I like the number you’ve been using, Nancy,” Mr. Trump told House Speaker Nancy Pelosi (D., Calif.), according to a Democratic aide. “Two trillion.”

In unusually positive comments about negotiations with the president, Mrs. Pelosi and Senate Minority Leader Chuck Schumer (D., N.Y.) said that the meeting was productive, and that they had agreed to return in three weeks to hear Mr. Trump’s ideas about how to pay for an infrastructure bill.

“There was goodwill in this meeting, and that was different than some of the other meetings that we’ve had,” Mr. Schumer said.