The Mets still will be on the hook for Perez’s $12 million salary this season, just as they are for Castillo’s $6 million. Those numbers would go down slightly if either actually makes a major league roster.

Now, it will be up to the Nationals to see if they can resurrect Perez’s career. He failed miserably at Citi Field after he was signed to a three-year, $36 million contract.

After going 0-5 with a 6.80 ERA and refusing a trip to the minors last season, Perez was given ample opportunity to prove he had value to the Mets this spring. But it became apparent to the team’s new regime that his velocity was down — as it was a year ago — and his days of throwing above the mid-80s with any consistency were over.

Perez, 29, had pitched this spring in the rotation and out of the bullpen as a lefty specialist, but lacked the location to make up for his lack of speed.

With Washington, Perez will be reunited with pitching coordinator Spin Williams, who was the Pirates’ pitching coach when Perez had perhaps his best season in the majors, going 12-10 with a 2.98 ERA and 239 strikeouts in 2004.