Troopers began to patrol on Long Island immediately after the formation of the New York State Police in 1917. Long Island was originally part of Troop K, and one of the earliest known details, "The Sunrise Trail Detachment," was formed in 1925 and operated out of Bayshore in Suffolk County. The detail was reorganized in 1928, as the Long Island State Park Detail, and moved to Babylon, expanding the role of troopers to police parks, parkways, athletic events, conduct investigations, supervise lifeguards, and regulate traffic. At that time in history, Long Island was mainly a rural area, and troopers were the only law enforcement presence. As local constabularies grew, troopers shifted their patrols from villages and towns which now had local police forces, and troopers began to focus their patrols to areas with little or no police protection. By 1959, troopers worked out of the Riverhead Barracks, where Troopers patrolled the five eastern townships of Suffolk County. On January 1, 1980, legislation merged the State Parkway Police into the State Police and formally established Troop L.