A worker in Japan could be nursing a protracted hangover after he lost a USB memory stick following a night out with colleagues as it contained the personal details of nearly half a million people, BBC reported.

The unnamed man placed the memory stick in his bag before an evening of drinking in the city of Amagasaki, north-west of Osaka.

Japanese man on a night out loses USB stick with entire city's personal details

He spent several hours drinking in a local restaurant before eventually passing out on the street, local media reported.

When he eventually came around, he realised that both his bag and the memory stick were missing.

Japanese broadcaster NHK reported that the man, said to be in his 40s, works for a company tasked with providing benefits to tax-exempt households.

He had transferred the personal information of the entire city's residents onto the drive on Tuesday evening before meeting colleagues for a night on the town, BBC reported.

City officials said the memory stick included the names, birth dates, and addresses of all the city's residents. It also included more sensitive information, including tax details, bank account numbers and information on families receiving social security.

Luckily for the man, city officials said the data contained on the drive is encrypted and locked with a password. They added that there has been no sign that anyone has attempted to access the information so far, BBC reported.

But the embarrassing incident prompted an apology from the officials, with the city's mayor and other leaders bowing in apology to residents.

"We deeply regret that we have profoundly harmed the public's trust in the administration of the city," an Amagasaki city official told a press conference.