Having Tina Fey play Dolly Parton was a compromise.

On Thursday’s “The Tonight Show Starring Jimmy Fallon”, the executive producer of W Network’s “Girls5eva” revealed how her cameo as the country music legend came about.

RELATED: The Cast Of ‘Girls5eva’ Talk To Drew Barrymore About ‘Hamilton’, Stripper Pole Lessons And More

“Don’t clap for that,” she said, as Fallon showed a photo of her in full Dolly costume. “Here’s what happened. Remember a long time ago, when I looked like Sarah Palin and everyone was like, ‘You should play Sarah Palin’? This is the opposite of that. No one asked for this.”

She continued, “It was in the middle of the pandemic when we shot this whole show, and we kept being like, ‘We’re going to try to get Dolly Parton,'” Fey said, explaining that they couldn’t get it to happen and time was running out. “It was literally like, ‘Who’s around? Who’s already COVID-tested and in the system?’ And it was me.”

RELATED: The Cast Of ‘Girls5eva’ Sing The Spice Girls’ ‘Wannabe’ With Jimmy Fallon And The Roots

Also on the show, Fey told the story of how her car’s GPS got her into an accident involving attempting to cross four lanes of traffic in order to not miss an exit.

“Girls5eva” premieres Thursday, June 3 at 9 and 9:30 p.m. ET/PT on W Network, and streaming on STACK TV.