Bernard "Barney" Fife is a fictional character in the American television program The Andy Griffith Show, portrayed by comic actor Don Knotts. Barney Fife is a deputy sheriff in the slow-paced, sleepy southern community of Mayberry, North Carolina. He appeared in the first five seasons (1960–65) as a main character, and, after leaving the show towards the end of season five, made a few guest appearances in the following three color seasons (1965–68). He also appeared in the first episode of the spin-off series Mayberry R.F.D. (1968–1971), and in the 1986 reunion television film Return to Mayberry. Additionally, Barney appeared in the Joey Bishop Show episode "Joey's Hideaway Cabin", and, unnamed, in the first episode of The New Andy Griffith Show. In 1999, TV Guide ranked him ninth on its 50 Greatest TV Characters of All Time list. Production history According to Andy Griffith, the character of Barney Fife was suggested by Don Knotts himself. At the same time The Steve Allen Show was ending, Knotts was looking for work. When he saw the episode of The Danny Thomas Show featuring Andy Taylor, he called Griffith suggesting that his sheriff character might reasonably need a deputy. Griffith liked the idea and suggested that he call Executive Producer Sheldon Leonard. Griffith later recalled that Don Knotts' contribution was the show's saving grace because he was uncomfortable with the original concept to have Andy Taylor being the comic lead. In an interview with The Archive of American Television, Griffith admitted, "The second episode was called 'Manhunt' and I knew by that episode that Don should be the comic and I should play straight for him. That made all the difference." Fife appeared on The Andy Griffith Show from the show's beginning in 1960 until 1965, when Knotts left the show to pursue a career in feature films. It is explained that Fife had left Mayberry to take a job as a detective in Raleigh, North Carolina. Knotts reprised the character in guest appearances each season until The Andy Griffith Show left the air in 1968. Barney also appeared in the inaugural Mayberry R.F.D. episode, in which Andy and Helen Crump marry. In 1971, the character, whose name is not explicitly mentioned, appears in the premiere episode of The New Andy Griffith Show, visiting the mid-sized city of Greenwood to catch up with Mayor Andy Sawyer, who looks exactly like Andy Taylor and