The team announced the pact Thursday before holding a news conference on Friday.
"I'm very excited with this contract, the opportunity to continue our work here, and I'm humbled by it," Harbaugh said in a statement released by the team.
"I am thankful for the support from the Ravens, especially Steve Bisciotti. We're working hard to make the 2019 Ravens the best we can be. We have an excellent team foundation, and we have a great organization with smart, hard-working people."
After a rocky start, Harbaugh and the Ravens switched from Joe Flacco to Lamar Jackson at quarterback and closed the regular season on a 6-1 run to finish 10-6. They lost to the Los Angeles Chargers at home in the AFC Wild-Card game, 23-17, on Jan. 6.
Harbaugh has compiled a 104-72 record in 11 years. The Ravens have won three AFC North titles (2011, '12 and '18) and have made six playoff appearances during his tenure. That included a 34-31 win over the San Francisco 49ers in Super Bowl XLVII in February 2013. His brother, Jim, was the coach of the 49ers at the time.