It was narrated from Ibn 'Abbas that:
a man declared Zihar upon his wife, then he had intercourse with her before offering expiation. He came to the Prophet (ﷺ) and told him about that. He said: What made you do that? He said: I saw her ankles in the moonlight, and I could not control myself, and I had intercourse with her. The Messenger of Allah (ﷺ) smiled and told him not to go near her until he had offered expiation.