Harrison Ford was the unwitting victim of a police training session gone awry ... TMZ has learned.
Cops in Huntington Beach, CA tells us Ford's name was entered into their arrest records by a newly hired officer during data entry training. It's S.O.P. for officers to enter fake names and info while learning how to use the system -- but they're supposed to delete all entries after each training session.
We're told that didn't happen with Harrison ... so his "arrest" for corporal injury on his spouse was auto-populated into the real police blotter. It's since been removed.
HBPD wants to stress it was an honest mistake, and Ford was never in any trouble whatsoever.