Then-Defense Secretary Chuck Hagel, after briefing reporters at the Pentagon in February 2014. (Carolyn Kaster/AP)

Former defense secretary Chuck Hagel on Thursday night accused President Trump of using U.S. troops as “pawns” as he moves to bolster the military presence at the southern border in response to migrant caravans making their way through Mexico.

“It’s clear to me that he’s using our military and our troops in a very political way. It really casts a lot of questions about the competency of his leadership,” Hagel, a former Republican senator from Nebraska who served as defense secretary in the Obama administration, said during an interview on CNN.

Trump said Wednesday that he would deploy as many as 15,000 military personnel to the border, doubling the figure Pentagon officials have announced would be operating there. It was one of several steps the president has announced in response to the caravans of Central American migrants as he tries to make immigration a salient issue in advance of next week’s midterm elections.

“As a former soldier . . . I know the kinds of sacrifices these men and women are involved with every day, and their families,” said Hagel, who served in Vietnam. “And to use them as political pawns like this, as a complete fabrication, is really wrong.”

Hagel said the troops would be of “limited utility anyway,” referring to a prohibition in federal law of the military acting in a domestic law enforcement capacity. The Pentagon has said the troops at the border will only be used in a supporting role.

Hagel also said he felt “disgust” in response to Trump’s suggestion during remarks at the White House on Thursday that U.S. military at the border could fire on members of the caravan if the migrants throw rocks at soldiers.

“That’s a wanton incitement of unnecessary violence,” Hagel said. “It’s a distraction, it’s a distortion, it is of rank political purpose to use our military like this.”

“Not in my lifetime have I ever heard those kinds of words from a president of the United States,” he added.

Trump’s plans also drew criticism Thursday from Martin Dempsey, a retired Army general who served as chairman of the Joint Chiefs of Staff under President Barack Obama.

In a tweet, he called the deployment of more troops to the border “wasteful”and suggested firing at the caravan would be a “disproportional” response.

“Our men and women in uniform are better trained, better equipped, and better led so they meet any threat with confidence,” Dempsey wrote. “A wasteful deployment of overstretched Soldiers and Marines would be made much worse if they use force disproportional to the threat they face. They won’t.”

An armed military presence at the border became a flash point more than two decades ago after a Marine fatally shot an American high school student who carried a rifle with him while herding goats. Within two months of the May 1997 shooting, the Pentagon suspended military patrols along the border.

Asked by a reporter Wednesday if the mobilization of troops was a stunt meant to stoke Trump’s political base, current Defense Secretary Jim Mattis said, “We don’t do stunts in this department.”