Two illegal immigrants have been arrested after they unsuccessfully tried to climb over a newly installed section of a border wall in California.

U.S. Customs and Border Protection said they caught the two men trying to illegally cross over into San Diego from Mexico.

Surveillance footage taken from the border showed the men trying and failing to scale the border wall.

The two men could then be seen trying to flee back towards Mexico but were forced to hide when border agents responded to the scene.

U.S. Customs and Border Protection said they caught the two men trying to illegally cross over into San Diego from Mexico. They are pictured trying to climb the new border wall

They appeared to be hiding in some crates when they were cornered by the border agents.

Officials said the newly installed primary border barrier thwarted the men's attempts to enter the U.S. and gave agents time to respond to take them into custody.

'Unable to scale the new primary border barrier and flee back to Mexico, two men who entered the U.S. illegally near San Diego were arrested by Border Patrol,' the CBP San Diego tweeted on Monday.

'Barriers give agents the time they need to respond and contain illicit activity at the immediate border.'

It comes after crews completed the primary border wall project earlier this month.

Surveillance footage taken from the border showed the men trying and failing to scale the border wall. The men could be seen trying to flee back towards Mexico after their attempt

The two men could then be seen trying to flee back towards Mexico but were forced to hide when border agents responded to the scene

They appeared to be hiding in some crates when they were cornered by the border agents in the white vehicle

The project, which was started on President Donald Trump's orders in 2017, replaced a decades-old border wall in San Diego.

San Diego's CBP chief, Agent Kathleen Scudder, said at the completion that she expected the new primary border barrier to be more of a deterrent than the last model.

The border wall stretches 14 miles and stands 18-feet tall.

The wall upgrade now allows agents to see through gaps in the steel beams so they won't be caught off guard.

The taller steel beams also take longer to climb, which gives agents more time to respond.

It comes after crews completed the primary border wall project earlier this month. The project replaced a decades-old border wall in San Diego