It was like giving a manager the boot — or at least a gentle shove — during a pennant-winning season.

Jeff Beal’s main title theme for “Monk” won an Emmy following the show’s 2002 debut. Even so, for the second season, a Randy Newman tune replaced Beal’s.

And Newman won the Emmy the following year.

“I loved Jeff Beal’s original theme song,” says “Monk” co-creator and executive producer Andy Breckman. “It fit the tone of our show wonderfully. But then we had this dilemma. Randy Newman was a fan of the show and offered to write a theme song. And I grew up admiring Randy Newman. He was one of my heroes; I actually started my career as a singer-songwriter.

“It was an embarrassment of riches, and at the end of the day it was impossible to say no.”

The producers divvied up their musical wealth by retaining Beal’s theme for the end credits. And at one point, the show’s writers decided to have some fun with the dilemma.

“When we first met Sarah Silverman,” Breckman recalls, “her character was an obsessive fan of Adrian Monk, and at the end of that episode, she begged Monk that if he ever gets his own TV show, ‘Whatever you do, don’t change the theme song.’ You have to love the inside jokes.”