An FBI agent told cops he lost his loaded gun in the back of a livery cab in Brooklyn over the weekend, authorities said Monday.

The G-man, 43, said he had his .380 semiautomatic weapon inside his pants holster on his right side when he got into the taxi outside 7509 Third Ave. in Bay Ridge around 2 a.m. Saturday. The address comes back to The Salty Dog sports bar.

The FBI agent said he then took the cab home and went to bed, according to cops. When he woke up in the morning, he realized the pistol was gone, he said.

The firearm was loaded with seven rounds.