The 29-year-old made 12 starts for the Giants in 2020, tossing 59.2 innings with a 3.62 ERA and 1.106 WHIP with 79 strikeouts on 16 walks.
The move gives San Francisco a fourth starter under contract alongside Johnny Cueto, Logan Webb and Tyler Anderson.
Bleacher Report's Joel Reuter ranked Gausman the 10th-best free agent this offseason, noting his age and a thin market for top-line starters made him an attractive option for teams. He becomes the second high-profile free-agent starter to accept a qualifying offer on Wednesday following Marcus Stroman's decision to return to the New York Mets.
According to Ken Rosenthal of The Athletic and Fox Sports, Gausman received multiple multiyear contract offers from potential suitors before accepting his qualifying offer.
In return, the Giants get a pitcher who can slot in anywhere from the No. 2 to No. 4 role in the rotation and help push along a rebuild that proved slightly ahead of schedule last season.
San Francisco finished 29-31, good for third in a surprisingly competitive National League West behind the Los Angeles Dodgers and San Diego Padres.