York also said the 49ers have already started its search for the team’s next head coach.
On Saturday, there were multiple reports that Harbaugh had accepted an offer from Michigan to become the school's next football coach. Michigan officials were reportedly in San Francisco this weekend to meet with the head coach.
On Sunday morning, Bruce Feldman of Fox Sports reported that Harbaugh is expected to be introduced at Michigan's men's basketball game on Tuesday. Jay Glazer of Fox Sports also reported Sunday that the Oakland Raiders remain "hopeful" about the chance of hiring Harbaugh.
"Jim and I have come to the conclusion that it is in our mutual best interest to move in different directions," said York. "We thank Jim for bringing a tremendous competitive nature and a great passion for the game to the 49ers. He and his staff restored a winning culture that has been the standard for our franchise throughout its history. Their commitment and hard work resulted in a period of success that should be looked back on proudly by our organization and our fans. We wish Jim and his family all the best."
"For the last four seasons I have had the great privilege to coach one of the storied franchises in the history of football," said Harbaugh. "We accomplished many great things together as a team during this period, which is a tribute to the incredible efforts of some of the most dedicated players and coaches in the NFL."
Harbaugh has a 44-19-1 record over four regular seasons with the 49ers, plus three NFC Championship games and one Super Bowl berth. He played quarterback for Michigan from 1983-86, and is renowned for guaranteeing a win against archrival Ohio State in his senior season.
Harbaugh also played in the NFL for 15 years until 2001, and served as the Raiders' quarterbacks coach in 2002 and 2003. He earned his first head coaching job at San Diego from 2004-06 before he was hired by Stanford in 2007. Over four seasons with the Cardinal, Harbaugh went 29-21, culminating in a 12-1, Orange Bowl-winning 2010 season with future Indianapolis Colts quarterback Andrew Luck at quarterback.
Michigan fired Brady Hoke earlier this month after he went 31-20 in four seasons. The Wolverines went 5-7 this season, missing a bowl for the first time since 2009.