Originally, Steve Martin was cast to play Barney Coopersmith, with Arnold Schwarzenegger playing the role of Vinnie Antonelli. However, Schwarzenegger was soon thereafter offered the role of Det. John Kimble in Kindergarten Cop (1990), and left the production. Failing to find another suitable "Vinnie" for Martin's Coopersmith, Martin offered to take on the role of Vinnie himself. Producers agreed, and then cast Rick Moranis as Coopersmith, who had originally been considered for the role, but was unavailable until then.
The story was loosely based on the life of Henry Hill after he went into witness protection program. Hill was the same man whose story was the basis of Goodfellas (1990). The films' respective writers, Nicholas Pileggi and Nora Ephron, were husband and wife.
At one point Vinnie calls Barney and says he got married, but not to worry as he didn't marry her under his real name. This actually happened to mobster Henry Hill when he was in the witness protection program in Seattle, when he married his then girlfriend Shelly. He got drunk and called his lawyer, then told him what happened, saying exactly was Vinnie said in the movie. His lawyer had the marriage annulled.
In Sweden, the movie was named, "How I Taught an FBI-agent to Dance the Marenge".
Henry Hill was not happy that the film was made because he knew that it was loosely based on his life story.