Why と言っていました and not と言いました


My textbook I studied from many months ago stated that to quote what somebody
said, you have to use と言っていました. I was wondering why that form is used and not
と言いました。 Is there any specific reason for it?

