WASHINGTON — Former U.S. President Barack Obama on Friday slammed President Donald Trump’s sending of troops to the border to guard against migrant caravans, calling the move “a political stunt.” Speaking at a rally for Democratic candidates in Miami five days ahead of midterm congressional elections, Obama criticized Trump, without mentioning his name. “They’re telling you the existential threat to America is a bunch of poor refugees 1,000 miles away,” Obama said. “They’re even taking our brave troops away from their families for a political stunt at the border. And the men and women of our military deserve better than that.” Obama was campaigning for Democratic Sen. Bill Nelson, ranking member of the Senate Armed Services Subcommittee on Cybersecurity, and Andrew Gillum, a Democratic gubernatorial candidate. Obama spoke just minutes after Trump told reporters that if migrants throw rocks at U.S. troops or border patrol officers, they’re not going to be shot, but they’re “going to be arrested for a long period of time.” Trump had previously said that he told the U.S. military mobilizing at the southwest border that if U.S. troops face rock-throwing migrants, they should react as though the rocks were “rifles.” The widespread criticism of those remarks included more than 100 Democratic lawmakers and former chairman of the Joint Chiefs of Staff, Army Gen. Martin Dempsey. Typically an advocate for an apolitical military, Dempsey offered a tweet Thursday countering the remarks. “Our men and women in uniform are better trained, better equipped, and better led so they meet any threat with confidence,” Dempsey’s tweet said. “A wasteful deployment of over-stretched Soldiers and Marines would be made much worse if they use force disproportional to the threat they face. They won’t.” But Trump said at the White House on Friday the U.S. won’t be firing on the migrants. Then he added that he hopes shots won’t be fired. He said what rock-throwing migrants did to the Mexican military was a “disgrace.” Trump says the U.S. is “not going to stand for” what they did to the Mexican military and police. As caravans of migrants from Central America are slowly winding north, one group got into a violent confrontation with Mexican police at the border with Guatemala, throwing rocks. Trump appeared to refer to that conflict. The Pentagon says more than 7,000 active-duty troops are being sent to the Southwest border; that number could increase to 15,000, according to Trump. The Associated Press contributed to this report.