The Yankees have agreed to sign first baseman / DH Billy Butler to add a righthanded bat for their playoff push, a baseball source confirmed on Wednesday night.

Butler, 30, was released by the A’s on Sunday. The Yankees lost rightfielder Aaron Judge to a Grade 2 oblique strain on Tuesday and expect him to miss the rest of the regular season.

advertisement | advertise on newsday

Butler hit .276 with four HRs and 31 RBIs for Oakland in the second year of a three-year, $30-million deal.

Butler was involved with teammate Danny Valencia in a clubhouse fight last month. Butler suffered a concussion. His last game for Oakland came on Sept. 6.

Butler will not be eligible for the postseason roster if the Yankees make it because he was not in the organization on Aug. 31.

The Yankees are set to face lefthanders in three of their four games in Boston starting with Eduardo Rodriguez in Thursday’s series opener. Butler could be in the lineup Thursday. The Yankees have been using third-string catcher Austin Romine as their righthanded DH.

advertisement | advertise on newsday

Butler spent his first eight seasons with the Royals before signing with Oakland as a free agent.