The pair were part of a four-man breakaway who moved clear of a larger 12-man group on the final descent into Meiringen after a 203.3-kilometre run from Montreux.
Cannondale's Sagan proved too strong for his breakaway companions in the sprint for the line, finishing ahead of last year's overall winner Rui Da Costa of Portugal and Czech Roman Kreuziger, with Frank fourth.
"It's been a dream of mine since I was a child," 26-year-old Frank, a native of Lucerne, told Swiss media when asked how it felt to be wearing the yellow jersey.
An elite group formed on the final category one Hasliberg climb as American Tejay van Garderen pushed the pace for his BMC teammate Frank.
That burst decimated the peloton until around a dozen riders were left but the next split happened on the descent when Italy's 2011 Giro d'Italia winner Michele Scarponi crashed into a grass verge, holding up those behind him.
Da Costa made an immediate dash to join the three ahead of him, but no-one else could bridge the gap and the stage win came down to the front four.
With three of that group eyeing overall victory more than a stage success, Sagan was never in any danger of being challenged and he won the sprint at a canter.
It was the 23-year-old's 50th UCI win and seventh stage victory in this event.
Previous leader Cameron Meyer of Australia was distanced on the final climb and finished one minute, 47 seconds down, not only losing the yellow jersey but dropping out of the top 10 overall.
Kreuziger moved up to second overall at 25 seconds with Da Costa third a further 10 seconds back.
It was a terrible day for another GC contender as 2012 Giro d'Italia winner Ryder Hesjedal of Canada crashed out of the race.