There is hereby granted over all school and public lands, now or hereafter belonging to the state, a right-of-way for ditches or canals and for tunnels, tramways and telephone and electrical transmission lines, constructed by authority of the United States. There is also hereby granted to any person holding a valid water right under statutes of this state a right-of-way for the construction of dams, canals, water ditches, and laterals over all school and public land now and hereafter belonging to the state, when constructed by authority of the commissioner of school and public lands. All conveyances and contracts of sale of school and public lands shall contain a reservation of such right-of-way. Purchasers of school and public lands shall have the right to obtain water from any irrigation system, parts of which may be located on such school and public lands, provided such lands are purchased within five years after the construction of any such irrigation system.
SDCL 5-4-2