The Marlins have trotted out five different players as their primary third baseman since trading Miguel Cabrera in 2007.

Casey McGehee will make it six.

McGehee, a 31-year-old free agent who spent last season playing in Japan following five years in the majors, has agreed to a 1-year contract with the Marlins, according to a source with knowledge of the agreement.

The Marlins had been in serious discussions with McGehee for days.

McGehee spent five seasons in the majors, primarily with the Milwaukee Brewers, before heading to Japan last season. He hit .289 with 27 home runs and 90 RBI for the Rakuten Golden Eagles of the Pacific League.

McGehee enjoyed his best season in the majors in 2010 when he hit .285 with 23 homers and 104 RBI for the Brewers. But he fizzled at the plate in subsequent years, hitting just .217 with nine homers in 2012 with the Pirates and Yankees.

The Marlins have been looking for a stopgap to man third as they await the development of Colin Moran, their first-round pick in 2013.

It’s been an active offseason for the Marlins, who have made improving a sluggish offense their priority. They have signed four starting position players -- three of them infielders -- to buttress the lineup: catcher Jarrod Saltalamacchia, second baseman Rafael Furcal, first baseman Garrett Jones, and McGehee.