This is one reason why, at least in the US, you should never talk to the police if you're suspected of a crime -- even if you're innocent and it seems that your innocence will be blindingly obvious to them[0]. Anything you say can and will be used against you, and by the rules of evidence, nothing you say to the police can be used for you in court. (Tell them you have a lawyer friend who will never let you live it down if you say anything without speaking to your attorney first.)
[0] https://www.youtube.com/watch?v=d-7o9xYp7eE
(IANAL)