MACON, Ga. — President Trump suggested Sunday that if Democrat Stacey Abrams becomes governor, she would turn Georgia “into a giant sanctuary city for criminal aliens” and he accused Democrats nationally of inviting illegal immigrants “to destroy our country, basically.”

Democrats want to “impose socialism and totally erase America’s borders,” Trump said as he campaigned for Georgia Secretary of State Brian Kemp in one of the nation’s most closely-watched gubernatorial races.

Trump is stoking fears about illegal immigration among his mostly white supporters in an attempt to increase Republican turnout in the midterm election Tuesday. His rhetoric was especially harsh Sunday, as he vowed to cut foreign aid to Central American nations he said had done nothing to stop a group of migrants from traveling toward the United States.

“How about that caravan? Do you want to let that caravan just pour in?” Trump asked, as a crowd that appeared be to a few thousand chanted “Build that wall” and he smiled.

The group now numbers about 4,000 and is in Mexico, hundreds of miles from the U.S. border.

“Last week, I called up the United States military. We’re not playing games here,” Trump said. “Because you look at what’s marching up. That’s an invasion.”

Trump has ordered more than 7,000 active-duty troops to deploy along the border in Arizona, California and Texas ahead of the election.

Kemp has run on his close allegiance to Trump, focusing on conservative rural parts of the state and embracing the president’s tough immigration policies and rhetoric.

Trump also said that Abrams would oversee a government seizure of firearms, repeating a claim that some of Kemp’s supporters have made.

“If Stacey Abrams gets in, your Second Amendment is gone! Gone! Stacey and her friends will get rid of it,” Trump said.

“You wouldn’t mind, somebody comes knocking in here, ‘Please, I’d like to have your guns turned over to the government. Turn over your guns, please give us all guns right now.’ ”

The crowd booed loudly.

Abrams favors stricter gun control but told a town hall gathering that “I am not planning to confiscate and ban guns.”

Trump called Abrams radical and extreme and criticized her policies, sometimes inaccurately, but did not repeat his earlier assessment that she is unqualified to be governor.

“I find his assessments to be vapid and shallow,” Abrams said of Trump on Sunday, during an interview on NBC’s “Meet the Press.” “I am the most qualified candidate. I am a business owner. I am a tax attorney who was trained at Yale Law School. I am a civic leader who helped register more than 200,000 Georgians.”

Abrams would be the nation’s first black female governor. The most recent polling shows race is a statistical tie.

“My opponent has run the most dishonest campaign” in the state’s history, Kemp told the crowd here. “She’s lying about me to hide her extreme agenda.”

Speaking before Trump arrived, Kemp cast the contest as a stand against liberals and outsiders energized by the high-profile race.

“The radical left is pouring millions into Georgia,” he said.

“They are itching for you to turn Georgia into California,” Kemp said, adding that “we can build a wall — a big, red, beautiful wall — around the state of Georgia to knock that blue wave down.”

Trump’s approval rating among Georgians was 46 percent in a Marist poll released Oct. 25, while his disapproval rate was 45 percent.

Earlier Sunday, Kemp announced an “investigation into the Democratic Party of Georgia” of a “failed attempt to hack the state’s voter registration system.”

His announcement contained no details about the alleged “cyber crimes” in which it suggests state Democrats were involved.

Democrats condemned what they called a political smear.

“Brian Kemp’s scurrilous claims are 100 percent false, and this so-called investigation was unknown to the Democratic Party of Georgia until a campaign operative in Kemp’s official office released a statement this morning,” Rebecca DeHart, executive director of the state Democratic Party, wrote in a statement to reporters.

“This is yet another example of abuse of power by an unethical Secretary of State.”

Trump’s appearance follows several days of visits by national figures supporting both sides in one of the nation’s most-watched gubernatorial races. For Republicans, keeping the Georgia statehouse is a test of party power and appeal in a changing state that Democrats argue could become a presidential battleground.

Oprah Winfrey was in the state Thursday in support of Abrams. Vice President Pence came the same day to stump for Kemp. Former president Barack Obama campaigned with Abrams on Friday, attempting to increase Democratic turnout with appearances at historically black colleges near Atlanta.

Former president Jimmy Carter, who also was governor, is backing Abrams and said last week that Kemp should resign as secretary of state.

Carter argued that Kemp’s position as Georgia’s chief elections official undermines public confidence in the vote in a race that is statistically tied. Abrams and Kemp could end up in a runoff election in December if neither receives a majority on Tuesday.

A poll released Thursday by WSB-TV and the Atlanta Journal-Constitution showed a statistically insignificant lead of two-tenths of a percent for Abrams: 46.9 percent vs. 46.7 percent for Kemp. The poll had a margin of error of plus or minus three percentage points.

Previewing his visit, Trump had told reporters Thursday that although he likes Winfrey personally, “the woman that she’s supporting is not qualified to be the governor of Georgia, by any stretch of the imagination.”

“I think Brian is going to be a great governor of Georgia. I think he’ll be a fantastic governor. He’s totally qualified,” Trump said at the White House.

Asked why the thinks Abrams is not qualified, Trump provided no specifics.

“Take a look,” he said. “Take a look at her past. Take a look at her history. Take a look at what she wants to do and what she has in mind for the state. That state will be in big, big trouble very quickly. And the people of Georgia don’t want that.”

Republicans are running scared, Abrams said when asked why Trump would declare her unqualified.

On CNN’s “State of the Union,” Abrams said that Republicans “can see the same numbers we are seeing.”

“I think they’re getting scared, and I think desperation tends to lead to comments that aren’t necessarily grounded in reality,” she said.

Abrams also responded Sunday to remarks by Agriculture Secretary Sonny Perdue, who said at a Saturday rally for Florida Republican gubernatorial nominee Ron DeSantis that “this election is so cotton-pickin’ important.”

“I think that there is certainly a throwback element to the language that we’re hearing coming out of the Republican Party that is, unfortunately, disparaging to communities,” Abrams said on “State of the Union.”

“It may be unintentional, but it signals a deeper misinformation about what Andrew Gillum can accomplish, what I can accomplish,” Abrams said.

Gillum, a Democrat, would become Florida’s first black governor.

Perdue was among the warm-up speakers for Trump here Sunday, and urged the crowd to rally support for Kemp among friends, including registered Democrats.

“That woman is not a Democrat,” Perdue said. “She’s a socialist, and they do not want her.”

Winfrey said her support for Abrams should not be read as a reconsideration of her disavowal of political ambitions.

“I don’t want to run, okay? I’m not trying to test any waters,” she told the crowd in Marietta.

She praised Abrams as a leader who “will serve the underserved of the state of Georgia.”

Speculation that Winfrey might challenge Trump as a Democrat swelled in January, when she delivered a powerful speech at the Golden Globes. Winfrey ruled it out.

At a separate appearance with Kemp on Thursday morning, Pence said he had “a message for all of Stacey Abrams’s liberal Hollywood friends: This ain’t Hollywood. This is Georgia.”

A final debate between Abrams and Kemp that had been scheduled for Sunday was called off when Kemp withdrew, citing Trump’s visit. Republicans denied that the Trump visit was a way to avoid the debate, noting that Kemp had accepted an alternate time on Monday. Abrams declined to reschedule, citing previous commitments.

Democrats accuse Kemp and Republican backers outside the state of trying to suppress Democratic voting, particularly among African Americans.

Kemp’s office came under intense scrutiny last month, when the Associated Press reported that more than 53,000 voter registration applications — 70 percent of them from African Americans — had been held up because the identification information was not an “exact match” to other state records, because of discrepancies such as a dropped hyphen in a person’s name.

On Friday a federal judge ordered the state to immediately stop using the rule, saying it probably violated the voting rights of a large number of people. Less than two weeks ago, in a separate case, a federal judge ordered election officials to stop automatically rejecting absentee ballots after advocates filed suit against a Gwinnett County, which threw out hundreds of ballots because of discrepancies in signature or missing addresses.

Sonmez reported from Washington. Avi Selk in Washington and Vanessa Williams in Augusta, Ga., contributed to this report.