San Francisco Giants outfielder Melky Cabrera has been suspended 50 games after violating Major League Baseball’s Joint Drug Prevention and Treatment Program.

Cabrera, the MVP of the 2012 All-Star Game, tested positive for testosterone. His suspension is effective immediately.

“My positive test was the result of my use of a substance I should not have used. … I am deeply sorry for my mistake,” Cabrera said in a release from MLB.

Cabrera has the second-best batting average in the National League at .346, behind Andrew McCutchen’s .359. The Giants (64-53) are tied for the NL West lead with the Dodgers.

The Giants have 45 games remaining this season. Cabrera’s suspension will carry over into the playoffs if the Giants advance to the postseason. If not, Cabrera will be suspended for the first five games of the 2013 season.