A police officer dropped a loaded pistol while guarding Prime Minister Shinzo Abe's motorcade in the city of Wakayama on Friday night, the police said, adding the gun was returned by a member of the public about an hour after it was mislaid.

The automatic weapon slipped out of its holster and onto the road while he was leaning out the window of a police car to direct traffic at around 7:50 p.m. Friday, the police said Saturday.

A resident taking a walk found the gun and handed it in at around 9:10 p.m. to one of the 50 or so officers who were combing the area for the weapon.

Abe was on his way to Kyoto after attending a meeting about his Liberal Democratic Party's upcoming leadership election.

The officer, in his 20s, was not using his holster strap but didn't violate the police department's gun-carrying protocol as he was working in plain clothes rather than in uniform, according to the police.

The police disclosed the incident at around 2:30 a.m. Saturday.

"It is very regrettable that such an incident occurred. We will make every effort to prevent a recurrence," Katsuro Matoba, security division chief at the Wakayama Prefectural Police, said in a statement.