The last time Alex Rodriguez had hip surgery was 2009. He did not return until May 8 that season, but managed to hit 30 home runs and knock in 100 runs, then went on a remarkable tear in the postseason to lead the Yankees to a World Series title. Four years later, Rodriguez is hoping for a taste of the same formula, although the recovery time could be three times as long.

Rodriguez had arthroscopic surgery Wednesday, this time on his left hip, and the Yankees said it went as planned, with no complications. The Yankees expect his recovery to take six months.

If all goes well, Rodriguez should be back in major league games soon after the All-Star Game, within days of his 38th birthday, which will be July 27, said the doctor who performed the surgery.

Dr. Bryan Kelly conducted the operation at the Hospital for Special Surgery to fix a torn labrum and an impingement in Rodriguez’s hip. Kelly told reporters last week that the injury was the result of the oblong shape of the femoral head in Rodriguez’s hip, and that he would reshape the bone into a more spherical shape in a two-hour procedure, and clamp the torn labrum back to the bone.

He also said he expected Rodriguez’s hip to return to full function and gain more range of motion. The only uncertainty was how much damage had been done to the cartilage in the hip over the years.

The Yankees signed the former Red Sox star Kevin Youkilis to a one-year, $12 million contract to play third base in Rodriguez’s absence.

The injury was discovered after the 2012 season, and Kelly said it helped explain Rodriguez’s poor performance in the playoffs. He was 3 for 25 in the postseason with no extra-base hits, and was pulled repeatedly for a pinch-hitter and ultimately benched. At the time there was no discussion of injury, but an examination revealed the hip injury after the season.

Although it was discovered in November, Kelly recommended that Rodriguez wait on the surgery until after he strengthened the affected area. He cited an improved and more rapid recovery time, similar to when Mariano Rivera waited several weeks before his knee was operated on after he tore his anterior cruciate ligament last year.

In 2009 Rodriguez had surgery on his right hip, also to repair a labral tear. Cody Ransom started at third base on opening day and shared time with Ramiro Pena while Rodriguez recovered.