WASHINGTON — The number of U.S. active-duty troops deployed to the U.S.-Mexico border has "pretty much peaked" at the current total of 5,800, the Pentagon's No. 2 official said Thursday.

That is far below the 10,000 to 15,000 that President Donald Trump initially said would be needed to secure the border against what he called an "invasion" of migrants.

Deputy Defense Secretary Patrick Shanahan was asked about the military mission one day after his boss, Defense Secretary Jim Mattis, visited troops near McAllen, Texas, and defended the use of the military for border security.

Mattis said that within a week to 10 days, the troops currently deployed along the border in Texas, Arizona and California will have accomplished all the tasks initially requested by Customs and Border Protection, although he said additional requests were expected.

Shanahan did not go into detail beyond saying substantial additional troops do not appear to be required.

"We've pretty much peaked in terms of the number of people that are down there," he told reporters at the Pentagon. He noted that the current mission is scheduled to end Dec. 15, adding, "That could always be amended."

Mattis, while on his way to visit troops along the border in south Texas on Wednesday, declined to provide an estimate of how much the mission will cost.

In his most extensive remarks about the hastily arranged mission, Mattis argued that it fits an historical pattern dating to early in the 20th century. He noted that President Woodrow Wilson deployed tens of thousands of National Guard and active duty troops to the border in 1916 in response to a Mexican military raid into the U.S. led by Gen. Francisco "Pancho" Villa.

He noted that more recently, National Guard troops were used in border missions ordered by President George W. Bush and President Barack Obama, although not on the cusp of a midterm election.

Mattis did not say how soon the mission might end.

In addition to the 5,800 active duty troops in the border area, about 2,100 National Guard troops have been providing border support since April.

Critics have questioned the wisdom of using the military on the border where there is no discernible security threat. Since the Nov. 6 election, Trump has said little about the matter, and no border threat has yet materialized.

Asked whether he believes there is a security threat at the border that justifies the use of the active duty military, Mattis said he defers to the judgment of Homeland Security Secretary Kirstjen Nielsen, who joined him at the border Wednesday.

Mattis said the short-term objective is to get sufficient numbers of wire and other barriers in place along the border as requested by Customs and Border Protection. The longer-term objective, he said, is "somewhat to be determined."

Mattis said the mission, which does not include performing law enforcement tasks, was reviewed by Department of Justice lawyers and deemed a legal undertaking. "It's obviously a moral and ethical mission to support our border patrolmen," he said.