MCALLEN, Texas (Reuters) - Acting U.S. Defense Secretary Patrick Shanahan made his second trip to the U.S.-Mexico border on Saturday as the Pentagon looks to develop a longer-term plan to support President Donald Trump’s immigration policies.

Shanahan traveled to McAllen, Texas, to meet with officials and visit a migrant processing facility and Border Patrol station, two days after the White House announced Trump’s intention to nominate the former Boeing Co executive as defense secretary.

“We’re not going to leave until the border is secure,” Shanahan told about two dozen border patrol officials as hundreds of detained migrants waited in tents to be processed.

Shanahan was accompanied by another acting secretary, Kevin McAleenan, who leads the Department of Homeland Security (DHS) after a shake-up instigated by Trump, whose hard-line immigration policies have not stemmed a rising tide of migrants.

On Friday, the Pentagon said Shanahan approved the transfer of $1.5 billion to build more than 80 miles (130 km) of barriers on the border, part of a patchwork project after Trump failed to secure funding from Congress for a complete border wall.

Trump has been eager to have the U.S. military play a larger role on the border and, despite some criticism from lawmakers, Pentagon officials say they are looking to create a long-term plan for assistance.

Shanahan told a small group of reporters traveling with him that military assistance would not continue “indefinitely,” but that it would be in place longer than months.

FILE PHOTO: Acting U.S. Secretary of Defense Patrick Shanahan speaks at a Strategic National Security Space: FY2020 Budget and Policy Forum hosted by the Center for Strategic and International Studies (CSIS), in Washington, U.S., March 20, 2019. REUTERS/Jonathan Ernst/File Photo

The Pentagon has tapped a two-star Army general to work with DHS to look at what military support will be needed in the future. Shanahan said he expected a plan from the general in the next few weeks.

“(It is about) getting us out of this à la carte tasking where, ‘Hey, we need 50 guys to do this, 50 guys to do that,’” a senior defense official said, speaking on condition of anonymity. The official said the idea was to look out over a time line of at least two years.

The official added that the Pentagon was reviewing a recent request from DHS to provide housing for detained migrants.

“What we’re hopeful to do is have, in fairly short order for the secretary of Homeland Security, a much more predictable, comprehensive plan for the next couple of years,” the chairman of the Joint Chiefs of Staff, General Joseph Dunford, said earlier this week.

There are currently about 4,500 U.S. service members on the border, and they are authorized to be there until through September.

DEMOCRATIC CRITICISM

The decision to transfer the $1.5 billion for border funding came on top of a March transfer of $1 billion in military money to fund the wall, which Democratic lawmakers criticized sharply.

Lawmakers have hinted they may respond by putting new restrictions on the Pentagon’s authority to move money around.

Shanahan said he understood Congress could take that authority away from the Pentagon and said he was unsure how to ease concerns. “I don’t have a good answer for how we’re going to balance it. It is a predicament,” he said.

The Pentagon is weighing which projects from the military construction budget will be affected to help pay up to $3.6 billion for the wall and whether there is a military need for it.