(Jerry Lai/USA Today Sports)

The Washington Nationals searched all offseason for an infielder and a left-handed bat for their right-handed-heavy lineup. After failed pursuits of other players, the team has finally found a solution. On Thursday, the Nationals reached a three-year deal with Daniel Murphy, the New York Mets’ slugging postseason hero, according to a person familiar with the situation.

Because the agreement is pending a physical exam, which will take place after the holidays, the Nationals have not yet announced the deal. ESPN’s Jim Bowden, the Nationals’ former general manager, was first to report the pact. Murphy will receive $37.5 million over three years, according to the person familiar with the agreement, and could receive bonuses if he wins individual awards.

Murphy, who will turn 31 on April 1, will likely see time at second base but has also played some first, third and left field. The Nationals will forfeit the No. 17 overall pick in the 2016 draft, and the Mets will gain a compensation pick between the first and second rounds because Murphy rejected a $15.8 million qualifying offer after the season. The Nationals gained a compensation pick when Jordan Zimmermann signed with the Detroit Tigers and would net another if Ian Desmond signs elsewhere.

The deal for Murphy happened quickly after a series of events. Despite a larger offer from the Nationals, switch-hitting utility man Ben Zobrist signed with the Chicago Cubs earlier this month. (The Nationals also pursued left-handed-hitting outfielder Jason Heyward before the Cubs inked him, too.) The Nationals had a trade in place with the Reds for their longtime second baseman Brandon Phillips, a right-handed hitter, but the veteran did not waive his no-trade rights because he wanted compensation from the Reds to do so.

Immediately after the Phillips trade lost traction this past weekend, Murphy was still considered low on the Nationals’ radar. The Nationals had also inquired this week about free agent second baseman Howie Kendrick, according to another person familiar with the situation, but he is right-handed and turns 33 in July. The need to plug in a proven infielder and left-handed hitter were the likely motivating factors for the Nationals. They had interest in Murphy in the past; at the 2014 trade deadline, the Nationals and Mets talked about Murphy before the Nationals ultimately traded for Asdrubal Cabrera instead.

Although he is limited defensively, Murphy is a tough out who doesn’t strike out often. He is a career .288 hitter and have averaged 69 strikeouts per season since 2011. He hit .281 with 14 home runs, 73 RBI and a 113 OPS+ (13 percent better than a league average on-base-plus-slugging-percentage) in 130 games in 2015. Murphy gained national attention for his Herculean playoff hitting, which helped propel the Mets to the playoffs: the National League Championship Series MVP smashed seven home runs in his first nine postseason games, including in six games in a row.

Murphy played 69 of his 130 games in 2015 at second base. Several advanced metrics rated him in the bottom third of second basemen with a minimum of 550 innings (but better than Kendrick.) Murphy also made a costly error in Game 4 of the World Series. But his bat and versatility could make his defense more palatable. He played 42 games at third base last season, 17 at first and saw some time in left field earlier in his major league career with the Mets. Murphy and Bryce Harper would be the only true left-handers in the Nationals’ everyday lineup next season.

Murphy’s presence lessens the load on Danny Espinosa and prospects Trea Turner and Wilmer Difo. Internally, the Nationals felt Turner, viewed as a potential shortstop of the future, may need a bit more seasoning, particularly on defense. Although Turner shot up through the minor leagues and impressed in his short stint in the majors late last season, it was only his first full professional season. Espinosa, a defensive wizard who enjoyed a bounce-back 2015 season at the plate after two years of struggles, is a natural shortstop and could be at the position on opening day.