Relief pitcher Will Harris is joining the Washington Nationals after they beat him in Game 7 of the World Series against the Houston Astros.

Harris and the Nationals have agreed to a $24 million, three-year contract, according to a person with direct knowledge of the deal. The person spoke to The Associated Press on condition of anonymity Friday because the agreement has not been announced.

The 35-year-old Harris dominated with Houston for much of the post-season, starting October with nine consecutive scoreless innings. The Nationals finally got to him late in the World Series, and Harris allowed Howie Kendrick's go-ahead home run in Game 7.

Washington went on to win its first World Series. Harris was stuck with the loss.

The right-handed Harris had a 1.50 ERA in 68 games for the Astros last season. He had been with Houston since 2015 and was an All-Star in 2016.

Harris will try to bolster a bullpen that was among the worst in baseball last season. Nationals relievers blew 29 saves and had a 5.68 ERA, both worst in the NL. Harris is likely to slot behind left-hander Sean Doolittle as the team's top setup man.