The 5-2 favorite was in contention at the top of the stretch and pulled clear at the finish for his fifth win in six starts.
"He's been a special horse since I first rode him," said Espinoza, who now has three Derby wins.
Hall of Fame trainer Bob Baffert got his fourth Derby win, and also sent out third-place finisher Dortmund.
Firing Line was second.
The time was 2:03.02 for the 1 1/4 miles. The largest Derby crowd ever - 170,513 - looked on under sunny skies.
The four Derby wins ties Baffert with D. Wayne Lukas and Herbert "Derby Dick" Thompson for second on the all-time list.
"We were ready to rumble," Baffert said.
The race unfolded with Dortmund setting the pace and Firing Line tracking in second. American Pharoah sat comfortably in third.
Turning for home, American Pharoah angled outside of the other two and launched a rally for a one-length victory.
"Turning for home, I thought I got it. The other horse was right next to me. I couldn't just blow him away," Espinoza said.
American Pharoah paid $7.80, $5.80, $4.20.
Firing Line returned $8.40 and $5.40 while Dortmund paid $4.20 to show.