The testes are located in the scrotum, which hangs outside the body. They are responsible for producing both sperm and the male hormone testosterone.