1743, "the plea of having been elsewhere when an action took place," from L. alibi "elsewhere," locative of alius "(an)other" (see
alias). The weakened sense of "excuse" is attested since 1912, but technically any proof of innocence that doesn't involve being "elsewhere" is an excuse, not an alibi.