With jockey Jesus Castanon aboard, Shackleford battled Flashpoint for the lead until midway through the final turn and then dug in to hold off the onrushing Animal Kingdom in front of 107,398 fans.
"He was a little hot in the beginning, but he was able to calm down," Castanon said. "He's a good horse and able to handle it."
It was the first victory in a Triple Crown race for Castanon and trainer Dale Romans, a Louisville, Ky., native, who watched Shackleford finish fourth in the Derby.
Shackleford's prerace antics weren't unusual for the colt. He often gets nervous and sweats excessively, not normally a good thing on a day when temperatures hit the 80s in sunny Baltimore.
"He wasn't acting that bad. It's a hot day, so that wasn't worrying me too much. I was more concerned at the quarter-pole if he was going to hold on," said Romans, who had one Breeders' Cup victory to his credit in his long career.
"I've won some big races, but none as exciting as that one," he said.
Shackleford paid $27.20, $10.20, and $6.80.
Animal Kingdom paid $4.20 and $3.60. Astrology paid $8 to show.
Dialed In was fourth, followed by Dance City, Mucho Macho Man, King Congie, and Mr. Commons. Isn't He Perfect was ninth, then came Concealed Identity, Norman Asbjornson, Sway Away, Midnight Interlude, and Flashpoint.
King Congie was named after Congie DeVito, a Temple alum and devoted Owls fan who died Feb. 16 at age 35 of complications from brittle-bone disease. DeVito worked for West Point Thoroughbreds, the syndicate that owns the horse.
Concealed Identity is a Smarty Jones colt, and Sway Away is a son of Afleet Alex.
Once again, fans' hopes to see a Triple Crown winner will have to wait for another racing season.
The last horse to sweep the Derby, Preakness, and Belmont Stakes was Affirmed in 1978. Big Brown was the last to attempt a Triple, in 2008.
Trainer Graham Motion, full of hope and expectation at the start of the race, looked on glumly as Animal Kingdom couldn't catch Shackleford in time.
"He ran huge. I was hoping he was going to get there," said Motion, who had kept the Derby winner at his stable 60 miles away in the Maryland countryside until race morning.
Shaking off his jitters, Shackleford broke alertly, as did another speedy horse, Flashpoint. They dueled through a quick opening quarter-mile of 22.69 seconds, just a fifth of a second off the Preakness record.
"It was fast, but he kind of pulled everyone else out of the race," Romans said.
As they sped along, Animal Kingdom and Dialed In, the second favorite, were running at the back of the 14-horse field.
"I kind of had to hustle him out of there," said John Velazquez, riding Animal Kingdom. "We lost a lot of ground in the first turn."
Velazquez tore through multiple sets of goggles as the dirt kicked back into Animal Kingdom's face, which he clearly didn't like.
"He broke so far back, the dirt started hitting him," the jockey said. "He had to make up too much ground."
Castanon was able to get Shackleford to relax into a comfortable rhythm as the pace slowed going down the backstretch. That proved to be a key moment.
"That kind of hurt us," Motion said. "That middle quarter really affected the outcome of the race."
At the top of the stretch, Animal Kingdom emerged as the main threat to Shackleford. He passed horses in pursuit of the leader while Astrology made a strong run along the rail. But the winner refused to give up.