Hours after winning their fifth straight game, the A's lost out on their bid to acquire infielder Hanley Ramirez from the Miami Marlins.

The Los Angeles Dodgers traded for Ramirez, getting the three-time All-Star in a deal that was widely reported late Tuesday night.

Before the Dodgers trade, the A's were engaged in trade discussions with the Marlins, a source with knowledge of the situation told this newspaper. However, the sides were not close on a deal.

The Dodgers reportedly got Ramirez and left-handed reliever Randy Choate from the Marlins for 22-year-old starting pitcher Nathan Eovaldi and Single-A relief pitcher Scott McGough.

The Los Angeles Times reported that the Dodgers are assuming all of the $38 million owed to Ramirez through 2014. Ramirez is making $15 million this season and is due $15.5 million in 2013 and $16 million in 2014.

Ramirez, a career .300 hitter who was batting just .246 with 14 homers and 47 RBIs entering Monday, was playing third base for Miami after spending his first six big league seasons at shortstop. He'll likely return to shortstop in Los Angeles at least until Dee Gordon returns from the disabled list.