Harbaugh was named the head football coach at Stanford University in December 2006, replacing Walt Harris.
Harbaugh's father, Jack, was Stanford's defensive coordinator from 1980 to 1981, while Harbaugh attended Palo Alto High School, located directly across the street from Stanford Stadium.

Harbaugh stirred some intra-conference controversy in March 2007, when he was quoted as saying rival USC head coach "Pete Carroll's only got one more year, though.
He'll be there one more year.
That's what I've heard.
I heard it inside the staff."
Upon further questions, Harbaugh claimed he had heard it from staff at USC.
The comment caused a rebuke from Carroll. (
In fact, Carroll would be at USC for three more years.)
At the Pacific-10 Conference media day on July 26, 2007, Harbaugh praised the Trojans, stating "There is no question in my mind that USC is the best team in the country and may be the best team in the history of college football."
The declaration, especially in light of his earlier comment, garnered more media attention.
Later in the season, Stanford defeated #1 USC 24–23 with a touchdown in the final minute.
With USC being the favorite by 41 points, it was statistically the greatest upset in college football history.
Although Stanford lost to USC in 2008, Harbaugh and the Stanford Cardinal upset USC at home again with a score of 55–21 on November 14, 2009.
Stanford's 55 points was the most ever scored on USC in the Trojans' history until Oregon scored 62 in a 62–51 win over USC on November 3, 2012.
It was Pete Carroll's first November loss as USC head coach.
Harbaugh never lost in USC's home stadium, the Los Angeles Memorial Coliseum.

In January 2009, Harbaugh was confirmed to have been interviewed by the New York Jets for the head coach position, although the job was eventually offered to Rex Ryan.

In 2009, the Cardinal had a comeback season, finishing the regular season at 8–4, finishing #21 in the polls, and receiving an invitation to play in the 2009 Sun Bowl, the Cardinal's first bowl appearance since 2001.
Running back Toby Gerhart was named a Heisman Trophy finalist, finishing second to Mark Ingram in the closest margin of voting in Heisman history.
On December 13, 2009, Harbaugh was rewarded with a three-year contract extension through the 2014 season.

The 2010 season brought more success for Harbaugh and the Cardinal.
The team went 11–1 in the regular season, with their only loss coming from Oregon, a team that was undefeated and earned a berth in the BCS National Championship Game.
The first 11 win season in program history earned the Cardinal a #4 BCS ranking and a BCS bowl invitation to the Orange Bowl.
Stanford defeated Virginia Tech 40–12 for the Cardinal's first bowl win since 1996 and the first BCS bowl victory in program history.
Second year starting quarterback Andrew Luck was the runner-up to for the Heisman Trophy, the second year in a row that the runner-up was from Stanford.
Harbaugh was named the winner of the Woody Hayes Coach of the Year Award.
Harbaugh was named the head football coach at Stanford University in December 2006, replacing Walt Harris. Harbaugh's father, Jack, was Stanford's defensive coordinator from 1980 to 1981, while Harbaugh attended Palo Alto High School, located directly across the street from Stanford Stadium.
Harbaugh stirred some intra-conference controversy in March 2007, when he was quoted as saying rival USC head coach "Pete Carroll's only got one more year, though. He'll be there one more year. That's what I've heard. I heard it inside the staff." Upon further questions, Harbaugh claimed he had heard it from staff at USC. The comment caused a rebuke from Carroll. (In fact, Carroll would be at USC for three more years.) At the Pacific-10 Conference media day on July 26, 2007, Harbaugh praised the Trojans, stating "There is no question in my mind that USC is the best team in the country and may be the best team in the history of college football." The declaration, especially in light of his earlier comment, garnered more media attention. Later in the season, Stanford defeated #1 USC 24–23 with a touchdown in the final minute. With USC being the favorite by 41 points, it was statistically the greatest upset in college football history. Although Stanford lost to USC in 2008, Harbaugh and the Stanford Cardinal upset USC at home again with a score of 55–21 on November 14, 2009. Stanford's 55 points was the most ever scored on USC in the Trojans' history until Oregon scored 62 in a 62–51 win over USC on November 3, 2012. It was Pete Carroll's first November loss as USC head coach. Harbaugh never lost in USC's home stadium, the Los Angeles Memorial Coliseum.
In January 2009, Harbaugh was confirmed to have been interviewed by the New York Jets for the head coach position, although the job was eventually offered to Rex Ryan.
In 2009, the Cardinal had a comeback season, finishing the regular season at 8–4, finishing #21 in the polls, and receiving an invitation to play in the 2009 Sun Bowl, the Cardinal's first bowl appearance since 2001. Running back Toby Gerhart was named a Heisman Trophy finalist, finishing second to Mark Ingram in the closest margin of voting in Heisman history. On December 13, 2009, Harbaugh was rewarded with a three-year contract extension through the 2014 season.
The 2010 season brought more success for Harbaugh and the Cardinal. The team went 11–1 in the regular season, with their only loss coming from Oregon, a team that was undefeated and earned a berth in the BCS National Championship Game. The first 11 win season in program history earned the Cardinal a #4 BCS ranking and a BCS bowl invitation to the Orange Bowl. Stanford defeated Virginia Tech 40–12 for the Cardinal's first bowl win since 1996 and the first BCS bowl victory in program history. Second year starting quarterback Andrew Luck was the runner-up to for the Heisman Trophy, the second year in a row that the runner-up was from Stanford. Harbaugh was named the winner of the Woody Hayes Coach of the Year Award.
Jim Harbaugh