Andy Taylor (Andy Griffith) returns to his hometown of Mayberry with wife Helen (Aneta Corsaut) (whom he had married in 1968, on the spin-off series Mayberry R.F.D.) but without his second-born son Andy Jr. (christened on R.F.D.). Andy's main purpose for returning is to witness his elder son Opie (Ron Howard) become a father, as his wife is nearly nine months pregnant.
Andy finds that his old deputy and cousin, Barney Fife (Don Knotts), has returned from Raleigh (where he had moved after Knotts left the series in 1965) to become the acting sheriff following the death of the preceding sheriff, and intends to run to win the position outright. However, he becomes annoyed as many townspeople assume that Andy has returned to take over the Sheriff's office (despite Andy's constant denial of the matter) and beg their old friend to take over. Barney also gets caught up in believing a commercial ploy to attract tourists to Myer's Lake via a mechanical monster. Meanwhile, Opie ponders moving his family out of Mayberry to expand his journalism career.
Most of the characters from the old series are revisited. The milquetoast Howard Sprague (Jack Dodson), in an attempt to look younger, is seen in various hues of hair color. The Pyle cousins, Gomer (Jim Nabors) and Goober (George Lindsey), share filling station duties (and are seen together for only the second time in Mayberry history). Howard Morris and Denver Pyle reprise the hillbilly roles of Ernest T. Bass and Mr. Darling, respectively, along with Maggie Peterson and The Dillards as the rest of the Darling clan. Otis Campbell (Hal Smith), the former town drunk, has become sober and now drives an ice cream truck.
In the end, Andy learns that hotel owner Wally Butler was using Ernest T. Bass and Barney to propagate a lake monster panic. A dragon artifact was confiscated from a defunct restaurant and planted in the lake to boost business. At a "victory rally" for Barney, an informal straw poll is taken. Andy is favored as sheriff despite not being on the ballot but, unwilling to keep Barney from realizing his dream, he has steadfastly refused to enter the race. However, in an emotional speech at the rally, Barney withdraws from the contest and endorses Andy who agrees to take the position. Upon returning to his rightful place as Andy's #1 deputy Barney finally marries his long time sweetheart Thelma Lou. The last shot seen is of the "new" sheriff and deputy putting up an American flag in downtown Mayberry.