I heard of a case where an undercover police officer was identified by a drug dealer, who pulled out a semi-automatic pistol and fired. The officer pulled out his pistol and returned fire.
Between the two they fired 20 shots. Neither one was hit.
During the gunfight, they were both in an elevator.