Michael Jackson’s commercial needed a little dancer. His Broadway show tried to stop him from going.

In early 1984, a 12-year-old boy from New York had one of the best jobs a kid could dream of.

He was starring on Broadway in “The Tap Dance Kid,” a musical about a boy who wants to dance more than anything. He played one of the leads, and the show went on to win Tony Awards.

Then the phone rang with an even bigger offer. Michael Jackson and his brothers were making a TV commercial in California, and they wanted a group of kids dressed just like them, dancing down the street. This boy was picked to be right in the middle of it.

The boy has said Michael was his idol. Years later he joked about how the job was pitched to him: “We’re just going to hang out in the street and just dance a little while. It’ll be fun.”

His show didn’t think it was fun at all. It told him he couldn’t leave for California and threatened to sue.

When the boy and his father got to the airport, the lawyers were already there waiting for them. “They had lawyers at the airport when we got there to board the plane,” he remembered. “And my dad was like, nope, we’re going.”

So they went.

On the set, the boy wore a red jacket, a blue shirt and one white glove, just like his hero. The director later said the boy was moonwalking down the street when he bumped right into the real Michael.

Here’s the commercial. Watch for the little boy in the red jacket.

The kid in the red jacket meets Michael on the street

The commercial was a smash. And the Broadway show that tried to stop him got a big surprise of its own. “Within 48 hours of the first airing of the commercial, we were sold out for two months,” he said.

Michael reportedly took a liking to the young dancer, too. He invited him out to Los Angeles, where the two of them had lunch and played video games together.

That little boy was Alfonso Ribeiro.

Six years later, he became Carlton Banks on “The Fresh Prince of Bel-Air,” the preppy rich cousin on Will Smith’s hit sitcom. And the goofy dance Carlton did to Tom Jones’s “It’s Not Unusual” turned into one of the most famous TV dances of all time. People still call it “the Carlton.”

In 2014, Alfonso brought that dance back on “Dancing with the Stars.” He went on to win the whole season.

Alfonso does “the Carlton” again, 30 years after meeting Michael

Today Alfonso hosts “America’s Funniest Home Videos,” and he hasn’t forgotten where it all started. As he told ABC in a recent interview, “Pepsi with Michael Jackson, yeah, back in the day, 1984.”