Sen. John McCain ripped into the head of U.S. Customs and Border Protection for an apparent policy restricting lawmakers from taking photos and interacting with people at facilities housing illegal immigrant minors, demanding the rules be reversed "immediately."

"I want it done today. You understand?" the visibly angry senator told CBP Commissioner Gil Kerlikowske at a Senate hearing on Wednesday, saying he "overstepped."

The hearing of the Senate Homeland Security Committee was called to receive updates on the border crisis from key agency heads involved in handling the influx of illegal immigrant minors from Central America. The tone of the hearing took a turn when McCain began questioning Kerlikowske on a memo described as "protocol for visitations and tours."

McCain said it restricted the use of cell phones, and restricted contact between visiting lawmakers and the children, as well as the staff.

"Am I allowed to bring a cell phone with me?" McCain asked.

"Not to take photographs," Kerlikowske responded.

Asked why not, the commissioner said the children "have a right to privacy."

McCain said he might want to take a photo of something else, and the commissioner said they could make "arrangements" for that.

Unsatisfied by the response, McCain cited other instructions restricting "physical or verbal contact" with children and with staff. Again, the commissioner said they could make "special arrangements" for visiting lawmakers.

But McCain said that when he visited the Nogales, Ariz., center in June, he was advised not to speak with children or staff.

"I view that as a violation of my responsibilities," he said. "I want it fixed, and I want it fixed immediately."

McCain continued: "I'm not supposed to even carry a cell phone with me? You have overstepped your responsibilities and your authorities, sir."

He called on the commissioner to immediately revoke the order.

McCain has a history of tension with CBP. Last year, he and other lawmakers criticized the agency for reports that it spent millions of dollars on homes in southern Arizona for its personnel. The Arizona Republic reported they paid more than $600,000 each for homes in an area where houses typically cost under $100,000.

McCain called the expense "disgraceful" and said people should be fired.