The invention relates to a method of automatically connecting a teat cup to a teat of an animal to be milked, in which method, after the position of a teat or at least part of a teat has been determined by means of a computer and it has been established that the teat forms an angle relative to a vertical plane, the teat cup is moved so that its opening is located under the end of the teat and is subsequently moved in a vertical and in a horizontal direction, consecutively or simultaneously, to the point where the teat merges into the remaining part of the udder, until the teat cup has been connected to the teat.