The history of psychology as a scholarly stuy of the mind and behavior dates back to the Middle Ages. It was widely regarded to a branch of philosophy until the middle of the 19th century, when psychology developed as an independent scientific discipline in Germany. Psychology borders on various other fields including physiology, neuroscience, artificial intelligence, sociology, and anthropology.