A police spokeswoman said Dunedin police were called to Marama St in Musselburgh at 11.30am following reports of a man holding a pistol while inside a vehicle.
Armed police attended the incident as a precaution, the spokeswoman said.
The 32-year-old man was taken into custody and the pistol was discovered to be an imitation firearm.
He was arrested and charged with unlawfully carrying an imitation firearm.