The Giants parted with one of their two ace-caliber starting pitchers. San Francisco traded left-handed pitcher Robbie Ray to the San Diego Padres on Monday, the team announced after ESPN’s Jeff Passan first reported the news.

The Giants received right-handed pitching prospect Miguel Mendez and shortstop prospect Joniel Hernandez from San Diego.

The 24-year-old Mendez was the Padres’ No. 4 prospect, according to MLB.com, and in 12 combined starts across the High-A and Double-A levels this season, posted a 4.79 ERA with 39 strikeouts and 17 walks in 35 2/3 innings pitched.

Hernandez, 17, was San Diego’s No. 9 prospect, and batted .303/.424/.503 with four home runs and 43 RBI in 155 at-bats in rookie ball.

Since his June 16 outing, Ray has been one of MLB’s best starters, posting a 1.65 ERA and 61 strikeouts in 60 innings.

In his final Giants start against the San Diego Padres on Thursday at Petco Park, Ray allowed four hits and one earned run while striking out six in six dominant innings.

“I tried to put everything out of my head leading up to this start, but yeah, it obviously...