Foreign Minister Murray McCully was searched at Auckland Airport before flying out to the United States last month.
The random search happened despite McCully travelling on a diplomatic passport.
A spokeswoman for McCully said the search was the result of an "administrative error".
"Due to an administrative error in New