A peace officer or a private person may break open a door or window of any building when necessary for the purpose of liberating a person who entered the building in accordance with the provisions of section 13-3891 or 13-3892 and is detained therein.