BIRMINGHAM, Ala. (WIAT) — It’s a small Alabama connection that almost didn’t happen.

Before “The Wire” became one of HBO’s landmark shows–one that has often been referred to as the best TV shows of the 21st Century— the real question would be how it should start.

As creator David Simon was putting together the show, which first aired 20 years ago Thursday, the real question became what would be the theme song to introduce the show. In a story published in Entertainment Weekly, Simon said he had originally wanted to use Tom Waits’ “Get Behind the Mule,” but felt it wasn’t working.

“It worked emotionally, but the verses were all way off point,” Simon told the magazine. “I kept trying to force it, tried to use different verses first, tried to play around with it. Finally, [executive producer] Bob Colesberry said, ‘I like the feel of it. I like the guy’s voice, but it’s not quite getting there.’ And I had to agree.”

Later, Simon discovered Waits’ “Way Down in the Hole,” featured on his 1987 album “Franks Wild Years.” Looking for a cover version of the song, Simon subsequently found one from the gospel group The Blind Boys of Alabama, which they recorded for their 2001 album “Spirit of the Century.”

“It worked perfectly, because for the voice to be African-American in that first season was important,” Simon said.

The Blind Boys of Alabama perform at the New Orleans Jazz and Heritage Festival in New Orleans, Sunday, May 3, 2015. (AP Photo/Gerald Herbert)

While recording “Spirit of the Century,” producer John Chelew said the Blind Boys, who had formed the group while students at the Alabama Institute for the Negro Deaf and Blind in Talladega, were not opposed to performing songs outside of their gospel catalog, but wanted to make sure they connected with them. “Way Down in the Hole” was no exception.

“(Founding member) Clarence (Fountain) told me, ‘We can’t sing these songs until we really understand their message – we’re not robots,'” Chelew said in the liner notes of the album. “So we discussed the lyrics and the concepts, of ‘Jesus Gonna Be Here,’ ‘Way Down In The Hole’ and ‘Give A Man A Home.’ The superficialities of the songwriting are different from what you hear in traditional Gospel, but underneath there’s the commonality of the human experience. Once Clarence identified with that, everything was fine.”

With the Blind Boys’ cover selected, all Simon and his team needed was Waits’ permission to use the song for the show.

“We were getting near our air date and we still didn’t have permission,” Simon said. “We mailed him versions of the show, so he could see what the show was about and he could see his song laid in, but he wasn’t responding. It was like, ‘Jesus, what are we going to do if he says no? We got to get him to sign off on this thing!'”

After a long period of uncertainty–including having “A Common Disaster” by Cowboy Junkies ready as a backup–Waits gave Simon and HBO permission to use his song.

The Blind Boys’ version of “Way Down in the Hole” opened each of the show’s 13 episodes the first season. Subsequently, the theme was covered by different artists each season, such as The Neville Brothers, Steve Earle and Waits himself. In the series finale, The Blind Boys’ full version of the song played out the final moments of the last episode.

Thursday marks 20 years that the show first aired on HBO.