The team announced the extension but did not disclose terms.
Rockies manager Bud Black said before the series opener at San Francisco that Márquez "would have garnered a lot of interest" on the open market, but wants to be part of turning the Rockies around.
"I think we know each other," Black said. "We know Germán and Germán knows this organization. He feels a strong loyalty to this organization and I think it speaks volumes to Germán wanting to be a part of this moving forward."
Márquez, 28, had Tommy John surgery in May and will miss most of 2024.
"Germán has been an integral part of the Rockies organization both on and off the field since his first Major League season in 2016," Rockies general manager Bill Schmidt said. "We are excited to secure Germán's future in Denver with this extension and can't wait to see him back out on the mound."
Márquez will make $10 million both years with $10 million in potential performance bonuses for 2025, sources said.
Colorado did have a $16 million contract option on Márquez for 2024 with a $2.5 million buyout. He signed a five-year, $43 million deal with the team in April 2019.
The agreement includes performance bonuses of $4 million in roster bonuses in 2025 and innings pitched bonuses, too.
Márquez was 2-2 with a 4.95 ERA in four starts this season before injuring his right elbow, striking out 17 with three walks in 20 innings.
Márquez is a former All-Star with a record of 65-56 and a 4.41 ERA in 176 games (173 starts) since making his debut with Colorado in 2016.
Information from Reuters was used in this report.