By Adam K. Raymond

The most famous fight in the history of Philadelphia, a city with a proud boxing tradition, took place 3,000 miles away in a largely empty arena where two novice boxers failed to connect on nearly every punch they threw. The fight that ends Sylvester Stallone’s 1976 classic Rocky is one of Hollywood’s most enduring portrayals of a once-great sport. But creating the sequence was no easy task. Like Rocky’s success, the final scene proved a fantastic achievement in the face of long odds. On the occasion of its 40th anniversary, we look back at the terrific puzzle the director, the writers, the actors, the set designers, and the cinematographer solved to produce a set piece that lives on four decades later.

The work on the scene began weeks before filming when director John Avildsen had Stallone (as underdog Rocky Balboa) and Carl Weathers (as the reigning champ Apollo Creed) duck under the ropes to throw a few punches in a Santa Monica gym. “They got in the ring, and one guy said, ‘I’m gonna do this,’ and the other guy said, ‘I’m gonna do this,’ and I realized they weren’t going to get anywhere,” Avildsen says on an extra for the Blu-ray edition of the movie. (All details and quotes are from the 2014 Heavyweight Edition.) Avildsen suggested that Stallone map out the fight, punch by punch, so the actors could learn it like a ballet. The actor returned the next day with more than a dozen pages mapping out the ebbs and flows of the fight.

Related: ‘Rocky’ Turns 40: Philly’s Most Famous Italian Stallion Impersonator on Why Rocky Matters More Than Ever

As rehearsals progressed, Weathers proved a quick study. Despite a complete lack of boxing experience, the former NFL player began to look the part after two weeks of eight-hour days in the ring. Both he and Stallone were helped along the way by the 8mm film Avildsen shot of them dancing around the ring. The director recalls showing the actors footage each day so they could see “how terrible they were,” inspiring them to work even harder. It wasn’t just to improve their boxing: Avildsen said he used the footage to show Stallone the extra flab he was carrying around his midsection, which would need to be gone by the time the real cameras began rolling.

Watch the fight:

With principal production under way, fight rehearsals continued and the actors refined what Stallone called their “violent dance.” Meanwhile, other preparations were made for the final fight. Avildsen showed composer Bill Conti his 8mm footage and played him Beethoven’s Symphony No. 6 to demonstrate the music he wanted for the fight. Makeup artist Michael Westmore built prosthetics and experimented with the colors necessary to make bruises show up on both Stallone’s and Weathers’s skin. Meanwhile, Avildsen struggled to figure out how to make an 8,000-seat arena in Los Angeles look full of fight fans despite a woeful lack of extras.

Art director James Spencer had some ideas for that, and it began with lighting. L.A.’s Grand Olympic Auditorium, which stood in for Philadelphia’s famous Spectrum, would be largely empty during filming. Spencer’s plan for masking that involved turning off all the arena’s lights except for those illuminating the ring. To give the illusion of depth, Christmas lights were strung halfway up the empty seats, and to make it seem as if people were moving around the concourse, Spencer backlit the open entrances and had extras walk back and forth as the cameras rolled.

When the big day arrived, Avildsen began by shooting the final round first. This allowed the gradual removal of the makeup and prosthetics Stallone and Weathers needed to make their faces look like they’d been through 15 rounds. The actors performed each round twice, once with cameras shooting through the ropes from outside the ring — a touch Avildsen said added to the realism — and another time with Steadicam operator Garrett Brown circling them in the ring.

“The idea is that if you’re faking a punch, there’s really only one good angle to see it: over the shoulder, where you have the wide angle effect of the boxer’s head snapping back, and you can’t see the point of contact,” Brown, who also invented the Steadicam, said on the Blu-ray extra.