The pizza delivery guy who was detained by immigration agents during a run to Fort Hamilton says he never agreed to let the Brooklyn Army base perform a background check on him.

“That is a lie. I didn’t sign anything. They never told me anything and I never signed anything,” Pablo Villavicencio told The Post in a phone interview from immigration detention Thursday.

Villavicencio, an undocumented immigrant from Ecuador, says he was detained by military police and then handed over to US Immigration and Customs Enforcement when he came to the base Friday to deliver Italian and a guard wouldn’t accept the IDNYC card he usually shows for identification.

The base says the 35-year-old father of two was told to obtain a daily pass to the garrison because he didn’t have a valid Department of Defense ID, and agreed to a background check as part of that process — which showed there was an an active deportation order out for him.

“Upon signing a waiver permitting a background check, Department of the Army Access Control standard for all visitors, an active Immigration and Customs Enforcement warrant was discovered on file,” said Fort Hamilton spokeswoman Cathy SantoPietro.

But Villavicencio insists he never signed anything.

“I am 100 percent sure that I did not sign any document there. The office has video and cameras there. I am sure you can access them to see that I didn’t sign anything,” he said.

SantoPietro didn’t respond to a request for a record of the waiver, and the Department of Defense said only Fort Hamilton would have it on file.

Additional reporting by Marisa Schultz