The Department of Homeland Security on Monday vowed to prosecute Central American migrants in a "caravan" near the U.S. border if they try to enter illegally and Attorney General Jeff Sessions said the effort was a "deliberate attempt to undermine our laws and overwhelm our system."

With the caravan on the final stage of its journey — about 440 miles, or a 12-hour journey by bus or train from the southern border — DHS Secretary Kirstjen Nielsen, acting under orders from President Donald Trump, said the agency was monitoring the group's movement and those who enter the U.S. illegally will be referred for prosecution. There are about 500 migrants in the caravan.

"Pockets of the original, so-called 'migrant caravan, which press reports indicate consists mostly of Honduran nationals, have begun to arrive at our southern border with the intent of claiming asylum," Sessions said. "These individuals — and their smugglers — ignored the willingness of the Mexican government to allow them to stay in Mexico."

Sessions added, "Let today's message be clear: Our nation has the most generous immigration system in the world, but this is a deliberate attempt to undermine our laws and overwhelm our system. There is no right to demand entry without justification. Smugglers and traffickers and those who lie or commit fraud will be prosecuted to the fullest extent of the law."

Nielsen said asylum-seekers will be detained while their cases are processed, and those who the U.S. determines don't have a legitimate claim will be "promptly removed from the United States."

"If you enter the United States illegally, let me be clear: You have broken the law," she said in a statement Monday. "And we will enforce the law through prosecution of illegal border crossers." Seeking asylum is legal.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Nielsen added that the administration had sent to the southern border additional ICE attorneys and Justice Department judges and prosecutors to ensure that all caravan asylum cases would be "adjudicated promptly."

The developments foreshadow a potential showdown on the border.

Most of the migrants in the caravan, who are fleeing violence in their home countries, plan to seek asylum once they get to the U.S, organizers have said.

Earlier Monday, Trump said on Twitter that he'd instructed DHS "not to let these large Caravans of people into our Country."

"It is a disgrace. We are the only Country in the World so naive! WALL," Trump said. He added that Mexico "must stop people from going through Mexico and into the U.S." and that could become “a condition of the new NAFTA Agreement."

Despite the Democrat inspired laws on Sanctuary Cities and the Border being so bad and one sided, I have instructed the Secretary of Homeland Security not to let these large Caravans of people into our Country. It is a disgrace. We are the only Country in the World so naive! WALL — Donald J. Trump (@realDonaldTrump) April 23, 2018

As of Monday afternoon, the caravan had made it to Hermosillo, Mexico, and organizers said members were heading northwest by bus and by train to the border crossing in Mexicali — on the Mexico-California border. They are expected to arrive at the border Tuesday.

Members of the dwindling group — about 1,000 originally set out on the journey — have traveled from Central America, through Mexico, fleeing persecution and violence in their home countries. The majority of people in the group are from Honduras.

About 100 have sought refuge in Mexico, while hundreds of others have stuck with the group with the intention of seeking asylum in the U.S.

"We have rights as humans to be safe, and I believe the troops at the border will respect that," one of the migrants in the caravan previously told NBC News.

Their journey was organized by a Central American and Mexican-based group called Pueblo Sin Fronteras (People Without Borders), which has been running caravans for more than 15 years to help people escape from dangerous situations in their home countries and protect them as they travel. This year’s journey, however, was thrust into the spotlight in recent weeks by Trump, who has angrily tweeted about the caravan.

Earlier this month, Trump repeatedly issued warnings on Twitter of dangerous "caravans" of immigrants headed for the U.S. border with Mexico, bringing drugs and crime with them.

The president also said women were "being raped at numbers never seen before" while the caravan is heading toward the U.S. He did not provide any evidence to support his claim.

Annie Rose Ramos contributed reporting.