A medical device for implantation in a hip joint of a patient. The hip joint has a caput femur (5) integrated with a collum femur (6) having a collum and caput center axis (CX), extending longitudinally along the collum and caput femur, in the center thereof. The medical device comprises an elongated portion (2201) adapted to at least partially replace the collum femur. The said elongated portion is adapted to be at least one of integrated in and connected to a prosthetic spherical portion (45) adapted to replace the caput femur. The prosthetic spherical portion in turn is adapted to be movably placed in a prosthetic replacement for the acetabulum (65) being fixated to the pelvic bone (9; 1801; 1802; 1803; 1804) and having at least one extending portion (1823) for clasping said prosthetic spherical portion. The elongated portion comprises a restricting portion adapted to restrict the motion range of the spherical portion in relation to said prosthetic replacement for the acetabulum. The restricting portion of said elongated portion is adapted to enable an advantageous motion range in relation to said prosthetic replacement for the acetabulum. A cross-section of said restricting portion of said elongated portion, perpendicular to the caput and collum center axis, comprises a first distance and a second distance, wherein a center point of a line of said first distance intersects a center point of a line of said second distance, and wherein said first distance is shorter than said second distance.