The head of a United States intelligence agency has been paying what until yesterday had been a secret visit to Wellington for talks with his New Zealand counterparts.

A US Embassy spokeswoman last night confirmed that the director of the National Security Agency, Lieutenant-General Keith Alexander, was in New Zealand for consultations with Government officials.

"We have nothing further to add," she said.

General Alexander's presence became known after he was apparently spotted by a reporter for an internet news service who saw him entering a Wellington building accompanied by security personnel.

The NSA is responsible for collecting and analysing foreign communications and foreign signals intelligence.

It also protects American Government communications and information systems.

The New Zealand equivalent is the Government Communications Security Bureau, which also collects and analyses foreign signals intelligence and provides security services to maintain the confidentiality of official information and data stored on public service computers.

A spokesman for the Prime Minister, who is on a four-day trip to South Pacific countries, said John Key knew General Alexander was in the country.

But the spokesman said he had nothing more to add as the Prime Minister did not comment on security matters.