When did swimming become a Olympic sport?

Swimming became an Olympic sport in the first modern Olympic Games in Athens in 1896.