The Major League Baseball said Cabrera tested positive for the banned performance-enhancing substance in violation of the drug agreement between owners and the players' association.
"My positive test was the result of my use of a substance I should not have used," Cabrera said in a statement released by the union. "I accept my suspension under the Joint Drug Program and I will try to move on with my life. I am deeply sorry for my mistake and I apologize to my teammates, to the San Francisco Giants organization and to the fans for letting them down."
Cabrera is batting .346 with 11 home runs and 60 RBIs in his first season with San Francisco and, flashing bright orange spikes, singled and hit a two-run homer last month in the National League's 8-0 All-Star win, which secured homefield advantage for the World Series.
He will miss the final 45 games of the regular season and serve the remainder of the suspension at the start of next season or during the postseason, depending on whether the Giants make the playoffs and how far they advance.
"We were extremely disappointed," the Giants said. "We fully support Major League Baseball's policy and its efforts to eliminate performance enhancing drugs from our game."
Cabrera became the second Giants player to receive a drug suspension this season. Reliever Guillermo Mota was penalized for 100 games in May, becoming just the third major league player penalized twice for positive drug tests.
There have been four suspensions in the major league drug program this year, with Philadelphia infielder Freddy Galvis and free agent outfielder Marlon Byrd also suspended 50 games apiece. There have been 70 suspensions under the minor league drug program.
The 28-year-old Cabrera, who became a marketing phenomenon with nicknames like "Got Melk?" ''Melk Man" and "Melky Way," produced a 51-hit month in May. Cabrera batted .429 in May with three homers, five triples, seven doubles and 17 RBIs. He hit safely in 25 of 29 games. The 51 hits matched Randy Winn for most hits in a month since the club came to San Francisco in 1958.
Cabrera also set the San Francisco record for most hits in May, passing Hall of Famer Willie Mays' 49 from 1958.
Cabrera came to the Giants in a trade with Kansas City last November that sent left-hander Jonathan Sanchez to the Royals. Cabrera - who signed a $6 million, one-year deal to avoid salary arbitration - batted .305 with 44 doubles, 18 homers and 87 RBIs last season.
He is a big reason San Francisco began play Wednesday tied with the Los Angeles Dodgers atop the NL West.
San Francisco said it wouldn't make a roster move until Thursday's off day before opening a weekend series at San Diego.