House Majority Leader Steny Hoyer, D-Md., acknowledged Wednesday on Fox News' "Special Report with Bret Baier" that border walls "obviously" work in some areas, and he rejected suggestions that barriers should be removed where they already exist.

The No. 2 House Democrat additionally asserted that the question of whether to fund President Trump's proposed border wall -- a dispute at the center of the unprecedented partial federal government shutdown -- is "not an issue of morality."

Hoyer's comments were seemingly at odds with the positions of other House Democrats, who have argued that border walls like the one Trump is proposing are ineffective and immoral.

In an interview last week, for example, Democratic Texas Rep. Veronica Escobar told CNN that "we know walls don't work, that they don't stop drugs, that they don't stop migration." Escobar also suggested she was open to destroying existing walls, remarking that they are "really ugly" and "monuments to division."

CNN'S ACOSTA MOCKED FOR INADVERTENTLY PROVING BORDER WALLS WORK

And House Speaker Nancy Pelosi, who has pledged not to fund Trump's border wall under any circumstances, said earlier this month that "a wall, in my view, is an immorality" and "the least effective way to protect the border and the most costly."

But Hoyer, pressed by Baier, distanced himself from those comments.

"Obviously, they work some places," Hoyer responded, when asked if he favored removing border walls. "But the president wanted to first build a wall apparently 1,954 miles of -- and he changed that very substantially. "

He added: "A wall is -- that protects people is not immoral. I think the issue is whether it works. ... And the debate ought to be not on morality or racism, I will -- I will say that we’re not pleased with some rhetoric that has come about dealing with those -- coming across the border, and we think some of the rhetoric was in fact racist. We think some of that rhetoric was to inflame and was not based upon facts."

Democratic leaders have previously supported building border walls. Senate Minority Leader Chuck Schumer, D-N.Y., and other Democrats, including then-Sens. Barack Obama and Hillary Clinton, supported the Secure Fence Act of 2006, which authorized the construction of some 700 miles of fencing at the border. As of 2015, virtually all of that fencing had been completed, according to government figures.

Border Patrol officials have also said that walls are effective. ("We certainly do need a wall. Talk to any border agent and they will tell you that," Border Patrol Chief Carla Provost said on Fox News' "Your World" last month.)

PELOSI TAKES HEAT FOR SUGGESTING STATE OF THE UNION SHOULD BE POSTPONED AMID SHUTDOWN

Hoyer suggested that Democrats were willing to compromise with the White House to end the shutdown, the longest in the nation's history.

"Well, we’re prepared to do that," Hoyer said, referring to reaching a deal with the Trump administration. "I think there can be a compromise position. There are all sorts of alternatives that we could pursue, I think, to come up with a consensus solution to achieve the objective I think we all want to achieve, and that is a secure and safe border for our country and for our citizens."

Hoyer stressed that Democrats have supported "substantial restraints," including fencing and other technologies.

"Obviously, they work some places." — House Majority Leader Steny Hoyer, D-Md.

Congressional Democrats on Tuesday rejected Trump's invitation to a lunch meeting at the White House to discuss border security, a move Hoyer said at the time was unhelpful. ("My advice to members is that if the president invites you and want to talk, you ought to go down," Hoyer told Fox News on Tuesday.)

"Unfortunately, the focus has been on one issue and that’s made it very, very difficult to discuss alternatives in ways of securing the border," Hoyer told Baier. "We don’t think the wall works -- as you know, an awful lot of Republicans didn’t -- don’t think the wall will work as well. ... Having said that, we’re prepared to work with the president to make sure our borders are secure. And that’s the important point."

Trump on Wednesday signed a bill guaranteeing back pay for federal workers who have been furloughed or forced to work without pay during the shutdown, which started Dec. 22.

Federal employees - including Secret Service agents -- received pay stubs with nothing but zeros on them last week. Some posted photos of their empty earnings statements on social media as a rallying cry to end the impasse.

Responding to Pelosi's explosive suggestion that the upcoming Jan. 29 State of the Union address by Trump to Congress should be delayed because Secret Service and Homeland Security agents are not receiving paychecks, Hoyer said no final decision has been made. All three branches of government traditionally gather in the Capitol for the high-security event.

"No, I don’t think it’s officially off. We -- I had not seen the speaker’s letter," Hoyer said. "What she suggests is a real security problem unless we’ve opened up the government. So -- and we haven’t gotten a reply from the president and his thoughts. So it’s -- it’s not officially off. No."

CLICK TO GET THE FOX NEWS APP

Security officials have pushed back on Pelosi's proposal, claiming the teams are prepared. And Republican officials scoffed at the idea -- though the decision ultimately rests with Pelosi.

“It is unbecoming of a speaker to do this,” House Minority Leader Kevin McCarthy, R-Calif., said Wednesday.

Fox News' Bret Baier, Brooke Singman, Chad Pergram, and Samuel Chamberlain contributed to this report.