At least a dozen illegal immigrants have been smuggled to the U.S. border, including an Afghan with terrorist ties who made it into Arizona before he was caught.

A trafficking network took the Middle Eastern immigrants on a convoluted route across South and Central America to avoid detection before crawling under the U.S. fence with Mexico.

Palestinians, Pakistanis and the Afghan with links to the Taliban were helped into the Western Hemisphere by a Brazilian gang who hooked them up with Mexicans near the border, according to official documents seen by the Washington Times.

The Afghan man was 'involved in a plot to conduct an attack in the U.S. and/or Canada', according to the Department of Homeland Security (DHS).

At least a dozen illegal immigrants have been smuggled to the U.S. border, including an Afghan with terrorist ties who made it into Arizona before he was caught. They were smuggled through 10 countries on their way to the United States. Their route is pictured above

Some of the Middle Eastern men were arrested before they crossed the border, but the Afghan and five Pakistanis made it to a ranch 15 miles north of the border in Arizona after scrambling under the fence.

According to the documents, the man's terror links were not immediately flagged up to border officers because he was not listed on their watch list.

His family ties to the Taliban were eventually uncovered after his name was run through an FBI database.

The five Pakistanis are understood to have since been granted asylum are are now living in the United States legally.

The smuggling network charged would-be immigrants for their services, which saw them travel from the region to Brazil.

From there, the migrants astonishing journey saw them travel through 10 countries on their way to the U.S..

Some of the Middle Eastern men were arrested before they crossed the border, but the Afghan and five Pakistanis made it to a ranch 15 miles north of the border in Arizona. File picture shows border agents on the U.S.-Mexico border in Arizona

After leaving Brazil, the men traveled through Peru, Ecuador, Colombia, Panama, Costa Rica, Nicaragua, Honduras, Guatemala and Mexico before crossing into America.

The documents were obtained by Republican Congressman Duncan Hunter, whose chief of staff Joe Kasper said the information was 'disturbing, in so many ways'.

'The interdiction of this group … validates once again that the southern border is wide open to more than people looking to enter the U.S. illegally strictly for purposes of looking for work, as the administration wants us to believe,' he told the Times.

'What's worse, federal databases weren't even synced and Border Patrol had no idea who they were arresting and the group was not considered a problem because none of them were considered a priority under the president's enforcement protocol. That's a major problem on its own, and it calls for DHS to figure out the problem - and fast.'

The DHS and U.S. Immigration and Customs Enforcement did not comment.