The Pittsburgh Pirates have agreed to trade All-Star second baseman Adam Frazier to the playoff-contending San Diego Padres for three minor leaguers, a person with knowledge of the deal told The Associated Press.

The person spoke on condition of anonymity Sunday because the deal had not been announced. The trade is pending physicals. Pittsburgh is sending approximately $1.4 million to the Padres in the deal.

Frazier was the National League starter in the All-Star Game this month. He leads the majors with 125 hits and is batting .324. He'll join a potent Padres infield that includes Fernando Tatis Jr., Manny Machado and Eric Hosmer.

Pittsburgh is receiving infielder Tucupita Marcano, outfielder Jack Suwinski and right-hander Michell Miliano in the swap. The MLB trade deadline is this Friday.

The Padres are 58-44 and third in the NL West, and hold a cushion for the second wild-card spot. The Pirates have the second-worst record in the NL.

Frazier was pulled in the eighth inning as part of a double switch in Sunday's 6-1 loss at San Francisco.

“Nothing’s final yet. I’m sure we’ll have that some time later tonight,” Pirates manager Derek Shelton said after the game.

“He was taken out of the game out of the abundance of caution because there are some things that are possibly going down.”

While the Pirates said nothing is official, pitcher JT Brubaker seemed to confirm a deal.

“I’m happy for the guy,” Brubaker said. “He’s going to go to a team that’s going to be in a playoff push down the stretch. Much deserved for him. All the hard work he’s put in, he’s going to go down there and continue to do the same thing. Going to give it his all. That’s who Adam Frazier is.”

Marcano is San Diego’s No. 5 prospect, according to MLB Pipeline. The 21-year-old shortstop made his big league debut this year, hitting .182 in 44 at-bats with the Padres. He was sent down to Triple-A El Paso in early June. He’s hit .272 with six home runs and 26 RBIs in 44 games for El Paso this year.

Suwinski, a 15th-round draft pick by the Padres in 2016, has hit .269 with 15 homers and 37 RBIs for Double-A San Antonio this season. The 21-year-old Miliano has made 22 relief appearances this year with two Class A teams, going 2-2 with a 3.60 ERA.