The man had an attack of conscience.

effect:
He admitted his indiscretion.