Border Patrol agents found an illegal immigrant hidden inside a pile of wood shavings at the the Otay Mesa border crossing in San Diego, authorities said.

The shipment was being transported from Mexico in a tractor trailer driven by a Mexican citizen with a valid visa.

During a secondary inspection, officers x-rayed the vehicle with an imaging system and noticed an "anomaly."

'Not Now, Not Ever': Mexican President Says Mexico Will Never Pay for a Border Wall

Student Sues School for Not Allowing Him to Wear Trump Border Wall Shirt

"In this situation, the truck trailer was x-rayed using the imaging system and we detected an anomaly, so we just did our inspection, went up there, removed the tarp from the top of the trailer and discovered one man hiding inside," said Customs and Border Protection Supervisor Shalene Thomas.

The undocumented man was taken to a hospital to be evaluated.

"Who's to say how long he was in there and what kind of damage was done, so in order to make sure that we did our diligence to make sure that this person was adequately checked out and safe, we took him to the hospital, got him evaluated and then he was released," Thomas said.

After the man was released, both he and the driver of the truck were taken into custody.

Watch the Fox 5 report below.

Tucker: Decade-Old Joy Reid Blog Posts Rip Migrant Workers, Praise Lou Dobbs

Wife of Man Deported to Mexico: 'I Can't Be Mad at Trump for Doing His Job'

ICE Director Blasts Trump's Critics: Calling MS-13 Animals Was Being 'Kind'