When were cats first kept as pets?

Though many say that cats have domesticated humans - rather than the other way around - from a scientific perspective, when were cats first kept as pets?