Follow KDKA-TV: Facebook | Twitter

(AP/KDKA) — The Pittsburgh made two trades late Friday night, selling off third baseman David Freese and shortstop Adeiny Hechavarria.

The Los Angeles Dodgers acquired Freese in exchange for a minor league infielder Jesus Manuel Valdez and the New York Yankees acquired Hechavarria for a player to be named or cash.

The deals were completed just ahead of the deadline for traded players to be eligible for postseason play.

Freese hit .282 with nine homers and 42 RBIs in 94 games for the Pirates while the 29-year-old Hechavarria is batting .254 with four homers and 29 RBIs in 76 games with the Tampa Bay Rays and Pirates this season.

Dodgers manager Dave Roberts said Freese would be used off the bench against left-handing pitching.

“Veteran presence, offensive, great clubhouse guy,” Roberts said.

In a statement, Pittsburgh general manager Neal Huntington said it was a “difficult decision” to trade Freese. Huntington said the move was made to give Freese an opportunity to pursue a World Series championship while giving opportunities to Pittsburgh’s younger players.

Freese won a World Series title in 2011 with St. Louis. He hit .545 and had 12 hits in the National League Championship Series, earning MVP honors. He was also named World Series MVP.

The move brings him back to Southern California. Freese played two seasons for the Angels in 2014 and ’15.

Valdez spent his first professional season playing for the Dominican Summer League Dodgers, batting .230.

The Yankees acquired Hechavarria to back up injured shortstop Didi Gregorius.

Gregorius has been out since Aug. 20 with a bruised left heel. He could come off the disabled list this weekend.

Hechavarria is a .255 career hitter over seven seasons with four teams. He has played mostly at shortstop with spot duty at second base and third base.

(TM and © Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)