The narrator of Edgar Allen Poe's "The Black Cat" is writing the story from his prison cell.
The man is writing everything down, and thus confessing everything, because he will not live past tomorrow. He is in prison for murdering his wife, and since he is going to be hanged in the morning for his crime, he doesn't see a problem with writing out his story.
The narrator actually might have gotten away with the murder of his wife, but he became overconfident with the investigating police. Just as the police officers were about to give up searching the cellar for the buried body, the narrator began bragging about its rugged construction. He tapped the wall exactly where his wife was buried, which caused the still alive cat to make a noise behind the wall. The men tore down the wall to rescue the cat and found the wife's dead body. They promptly arrested the narrator and took him to be hanged.
The corpse, already greatly decayed and clotted with gore, stood erect before the eyes of the spectators. Upon its head, with red extended mouth and solitary eye of fire, sat the hideous beast whose craft had seduced me into murder, and whose informing voice had consigned me to the hangman. I had walled the monster up within the tomb.