President Donald Trump said Tuesday he would sign legislation to extend DACA protections for undocumented young people in exchange for increased border security measures, adding that after that, he would be open to comprehensive immigration reform.

"You guys are going to have to come up with a solution [for DACA], and I'm going to sign that solution," Trump said during a bipartisan meeting of House and Senate leaders at the White House on Tuesday morning.

"When you talk about comprehensive immigration reform, which is where I would like to get to eventually," Trump said, turning to Senate Minority Whip Dick Durbin, D-Ill., "If we do the right bill here, we are not very far away, we've done most of it. You want to know the truth, Dick, if we do this properly, DACA, you're not so far away from comprehensive immigration reform. And if you want to take it that further step, I'll take the heat. I don't care," said Trump.

"My positions are going to be what the people in this room come up with," the president later told the press pool. "If they come to me with things I'm not in love with, I'm going to do it, because I respect them," Trump said, flanked by Durbin and House Minority Whip Steny Hoyer, D-Md.

After the meeting Tuesday, Senate Majority Leader Mitch McConnell said he wants to handle a DACA solution and and government spending separately.

"It is still my view that I will call up a DACA-related immigration bill that I know the president will sign and that it will not be a part of any spending agreement," the Kentucky Republican said.

After the meeting, the White House also released a statement, saying the president and negotiators "reached an agreement to negotiate legislation that accomplishes critically needed reforms in four high-priority areas: border security, chain migration, the visa lottery, and the Deferred Action for Childhood Arrivals policy."

Trump stressed that both Democrats and Republicans want to find a way to extend DACA protections, but he stressed that any such bill would need to end preferential immigration status for the family members of immigrants, and cancel the green card lottery program.

Trump did not put as much emphasis Tuesday on building a wall along the southern border as he has at previous events, although he did mention erecting a barrier along "a portion" of it. This, along with his insistence that he would sign on to whatever deal congressional negotiators reach, is potentially a sign of progress in the tense negotiations.

Democrats have consistently said that appropriating billions of dollars to build a wall would be a nonstarter for talks, and they have threatened to withhold funding for the government, effectively forcing a shutdown, if Republicans continue to insist on funding for a wall as a condition of protecting approximately 800,000 so-called Dreamers: young people who were brought to the United States illegally as children.

Former President Barack Obama used an executive order to permit many Dreamers who completed high school to apply for work permits. Trump rescinded that order last fall, and gave Congress six months to come up with a fix before Dreamers would become eligible for deportation.

The press pool was permitted to stay in it for nearly an hour, far longer than reporters are usually allowed to film presidential meetings. The tone was collegial but energetic, with lawmakers from both parties taking turns expressing their positions, and Trump playing the role of an informed and engaged moderator.

"I know most of the people [in this room] on both sides, have a lot of respect for the people, on both sides, and what I approve is going to be very much reliant on what the people in this room come to me with. I have great confidence in these people," Trump said near the close of the meeting.