“NCIS,” which stands for Naval Criminal Investigative Service, is a spin-off from “JAG.” The drama focuses on a team of special NCIS agents that conduct criminal investigations involving the U.S. Navy and Marine Corps.

Rather than writing the script and then searching for appropriate songs that will work with the episode, the songs are chosen while the show is being put together so the tunes aren’t just an afterthought.

“We did, in my belief, take a new approach on it,” Josh Rexon, the show’s producer, says. “[The goal was] to get a lot of material in, as early as possible … and then find some really fun moments to give those to the fans.”

Using an artist’s song on TV shows such as “Grey’s Anatomy” or “The Hills” can break an artist to a mainstream audience and boost record sales. To be chosen for a show like “NCIS” has to be such an honor, to not only be featured on a hit series but actually be the inspiration behind the script.

“NCIS” has used exclusive songs by acts such as Perry Farrell and Jakob Dylan as well as previously released songs by Bob Dylan, John Mellencamp and more.

“We probably got the producers 50 songs to listen to,” Larry Jenkins, who produced and compiles the music for the show, said. “They might listen and go …, ‘Hey, this Blue October song, this is perfect for this story line. … Hey writers, read these lyrics, use this to write your scene.'”

Here’s the story behind choosing Farrell’s “Nasty Little Perv,” which was used to kick off an episode that led to a hotel room liaison:

“The writer of that episode thought that song would be really appropriate and driving, and it has a lot of energy,” Rexon says. “We also give those songs not only to the writer, but to the director, and you can see how the director directed (the scene). He really spent a long time panning up the legs, the face. When the writer and director have the song early, they are able to take the scene and do something cool like that.”

Readers, tell us – what’s one of your favorite songs used in a TV series? I’m partial to all the songs used over the course of the four seasons of “The O.C.” (R.I.P.).

Read the AP story here.