Gregorius, an 11-year major league veteran, had been with the Phillies since signing as a free agent ahead of the 2020 season.
The 32-year-old struggled mightily at the plate this season for the Phils, despite playing solid defense at shortstop. In 63 games, Gregorius slashed .210/.263/.304 with one home run and 19 RBI while posting 36 strikeouts to just 13 walks.
Gregorius finishes his time in Philly, having compiled 24 home runs and 113 RBI while slashing .230/.287/.384 over 226 games.
Segura, a two-time All-Star, hasn’t played since suffering a fracture to his right index finger back on May 31, which required surgery.
The 32-year-old had been playing well before the injury.
Segura batted .275/.324/.407 with six home runs and 19 RBI through 44 games. He also led the Phillies in stolen bases with eight before missing time.
In the NL East Division race, the third-place Phillies (56-48) trail the Atlanta Braves (63-42) by 6.5 games and the division-leading New York Mets (66-38) by 10 games.
Entering play on Thursday, the Phillies and St. Louis Cardinals were tied for the third NL wildcard spot; the San Diego Padres (61-46) and Atlanta Braves (63-42) hold the top two slots.
The closest threats to the Phillies and Cardinals are the San Francisco Giants (51-54), sitting 5.5 games back, and Miami Marlins (48-57), who are 8.5 games behind the pace.