Ricky Martin believes the “stars were aligned” for him to play Antonio D’Amico, Gianni Versace’s longtime partner, on “The Assassination of Gianni Versace: American Crime Story.” Unbeknownst to creator Ryan Murphy, the singer/actor is good friends with co-stars Edgar Ramirez and Penelope Cruz, and Ramirez had already told Martin that he had been cast as the late fashion designer before Murphy, with whom Martin worked on “Glee,” came calling to have dinner.

“I went there and he said, ‘I have a project I want you to be part of.’ And the thing was Edgar had told me he was going to be playing Gianni,” Martin tells Gold Derby in an exclusive video interview (watch the exclusive video above). “I was like, ‘That’s fantastic! Whatever you need from me. Whatever you need, let me know.’ Two weeks later, Ryan calls me and he tells me he has a part for me to be Antonio. Of course, I was screaming inside, [but] I didn’t want to show it. I said, ‘Who’s playing Donatella?’ ‘Penelope Cruz. No one knows.’ I’ve known Penelope for many years.

SEE Emmys exclusive: FX’s categories for ‘Atlanta,’ ‘Versace,’ ‘The Americans’ and more

“The fact that I was going to be surrounded by an amazing, amazing group of actors and friends made it even more special,” he continues. “When I told him, ‘I love Edgar, I love Penelope,’ Ryan teared up. It just felt right that the stars were aligned for this to happen.”

But more meaningful than working with his close pals was the message behind the limited series. While the title is ostensibly about Versace’s 1997 murder at the hands of Andrew Cunanan (Darren Criss), the show was, among other things, an exploration and indictment of failings of the FBI investigation and how homophobia allowed Cunanan to go on a killing spree in plain sight.

“I think the story is full of injustice, homophobia,” Martin says. “I do this for my kids, for my family, and to create awareness, to create consciousness. At the end of the day, this is a story that could happen again. The fact that we’re being so loud and direct to the audience, and raw and real about this unfortunate crime is something very important.”

For Martin, “Versace” was also deeply personal. Having been closeted during the height of his music career before coming out in 2010, Martin says playing Antonio was cathartic and “extremely emotional.” One vital scene is when Versace brings Antonio with him for his interview with “The Advocate,” in which he came out at a time when bold-faced names weren’t.

“As an actor, I was now on the other side of the fence of most partners I had been dating when I was in the closet,” Martin says. “For Edgar to see this what this scene meant to me was extremely powerful. I lived in the closet for many years and I created a sabotage to love, from the people I was dating at the time and for self-love and dignity. It was extremely powerful.”

Martin hopes the series helps normalize open LGBT relationships and for “more people with the power that Gianni had” to come out to aid in that. “When I came out, the love from the audience and social media was amazing, but when I was doing the scene, I was like, ‘Oh, I wish I could come out again!’” he says with a laugh. “Because it is extremely important and that is one of the reasons why I said yes to this story.”

PREDICT the Emmy nominees and winners now; change them until July 12

Be sure to make your Emmy predictions today so that Hollywood insiders can see how their TV shows and performers are faring in our odds. You can keep changing your predictions as often as you like until just before nominees are announced on July 12. And join in the fun debate over the 2018 Emmy taking place right now with Hollywood insiders in our television forums. Read more Gold Derby entertainment news.

SIGN UP for Gold Derby’s free newsletter with latest predictions