OXON HILL, Md. — Left-hander Jeff Locke has agreed to a one-year contract with the Miami Marlins worth $3,025,000, according to two people familiar with the negotiations.

In addition, the Marlins agreed to a $2.5 million, one-year contract with catcher A.J. Ellis and kept right-hander Dustin McGowan for a $1.75 million, one-year contract, one of the people said.

The people spoke on condition of anonymity Wednesday because the agreements had not been announced.

The 29-year-old Locke had spent his entire big league career with Pittsburgh and was 9-8 with a 5.44 ERA this year in 19 starts and 11 relief appearances, his highest ERA since 2012.

His best season was 2013, when he went 10-7 with a 3.52 ERA in 30 starts, earning a spot on the NL All-Star roster.

Locke gets the same salary he had this year with the Pirates. He became a free agent when Pittsburgh failed to offer a contract by the Dec. 2 deadline.

McGowan, 34, had a 2.82 ERA in his first season with the Marlins, striking out 63 in 67 innings.

Ellis, who turns 35 in April, hit .216 with 22 RBIs this year in 64 games with the Dodgers and Philadelphia, which acquired him Aug. 25 in the trade that sent Carlos Ruiz to Los Angeles. Ellis caught many of Clayton Kershaw's starts with the Dodgers.