US 340's name changes to Jefferson National Pike as it enters Frederick County. The highway leaves the Potomac Water Gap and enters the Middletown Valley at its partial interchange with MD 180 (Jefferson Pike) at Knoxville; there is no access from westbound US 340 to eastbound MD 180 or from westbound MD 180 to eastbound US 340. The U.S. highway meets MD 17 (Burkittsville Road) at a diamond interchange near Rosemont and crosses Little Catoctin Creek. East of Petersville, US 340 has a diamond interchange with MD 180 and crosses Catoctin Creek. On the western edge of Jefferson, westbound US 340 receives a ramp from MD 180. Full access to Jefferson is provided by a diamond interchange with Lander Road. The U.S. highway passes through a wide gap in Catoctin Mountain and has a partial interchange with US 15 (Catoctin Mountain Highway), which heads south toward Point of Rocks. Access from northbound US 15 to westbound US 340 and from eastbound US 340 to southbound US 15 is provided through performing a U-turn at the concurrent highways' next interchange, a diamond interchange with Mt. Zion Road.