The San Francisco Giants landed a top-tier starter to complement ace Madison Bumgarner, agreeing with free-agent right-hander Jeff Samardzija on a five-year, $90 million contract Saturday, a day after losing out on pitcher Zack Greinke.

The Giants said a formal announcement will come once Samardzija passes a physical, which is scheduled for Tuesday.

The 30-year-old Samardzija chose the Giants over the Dodgers and Cardinals, a source told ESPN's Jerry Crasnick.

This marks the third large contract for a pitcher this week. David Price joined the Boston Red Sox on a $217 million, seven-year deal, then on Friday night Greinke chose the Arizona Diamondbacks over the Giants and three-time defending NL West champion Dodgers, his former team. Greinke's deal is for six years, according to ESPN and media reports, and is worth a total of $206 million, a source told ESPN's Pedro Gomez.

Samardzija joined the White Sox via trade at the 2014 winter meetings to take over as the club's No. 2 starter, only to have an inconsistent 2015 season.

Heading into the July 31 non-waiver trade deadline, he delivered 10 consecutive starts of at least seven innings. After not being traded at the deadline, he immediately went 1-8 with a 9.24 ERA over his next nine starts.

Jeff Samardzija won a career-high 11 games this past season for the White Sox but had a 4.96 ERA over his 32 starts. Photo by Jonathan Daniel/Getty Images

In his first full season in the American League, Samardzija went 11-13 with a 4.96 ERA that was third-highest among all qualified AL pitchers. It was his highest ERA in his four seasons as a major league starter. He has 13 losses in each of those four seasons.

The Giants won the World Series in 2010, '12 and '14 but missed the playoffs in the odd years, including this past season. A top priority this offseason was to build their rotation behind Bumgarner, the 2014 World Series MVP.

Matt Cain was slowed by further elbow issues after surgery late in the 2014 season that cost him the postseason. Tim Hudson retired and Mike Leake and Ryan Vogelsong are free agents. Two-time NL Cy Young Award winner Tim Lincecum's future is unclear following left hip surgery Sept. 3.

San Francisco had said there was interest in bringing back Leake, but informed the pitcher that wouldn't be the team's first order of business.

Last month, the Giants signed homegrown All-Star shortstop Brandon Crawford to a $75 million, six-year contract that takes him through the 2021 season and includes a full no-trade clause.

ESPN.com White Sox reporter Doug Padilla and The Associated Press contributed to this report.