The Washington Nationals and Justin Upton agree to a two-year deal

Nationals outfielder Justin Upton and first baseman Ryan Zimmerman signed a three-year contract on Wednesday, according to a source with knowledge of the agreement.

The deal will pay Upton $21 million over the three years, including $17 million in base salary, according a source familiar with the contract.

Upton, 27, is entering the final year of his deal with a $21.5 million club option for 2019.

The Nationals selected Upton in the first round of the 2015 draft and have been reluctant to let him walk in free agency.

Upton is hitting .298 with 13 home runs and 40 RBIs in 115 games for the Nationals.

He was designated for assignment by the Nationals in March.

Zimmerman, 26, was acquired from the Philadelphia Phillies in a deal that sent Michael Taylor to the Rays.

He is batting .300 with 10 home runs in 63 games for Miami.

The 27-year-old was originally slated to make $3.8 million this season, but was demoted to Triple-A Durham and is batting just .218.

The 6-foot-2, 200-pound Zimmerman is entering his third season in the big leagues after making his big league debut in 2016.

He played in all eight games for Atlanta in 2016, going 1-for-6 with a walk.

Zimmerman was designated in June for assignment after the Braves were swept by the Chicago Cubs.

The Braves traded catcher Ryan Lavarnway to the Nationals earlier this month.