In 1914 Hernández was elected to the U.S. House of Representatives; he sought reelection in 1916, but was defeated by William B. Walton. He was a delegate to the Republican National Convention that year, as he had been at the last one. Hernández was elected to the U.S. House seat again in 1918 when Walton ran for the U.S. Senate instead of seeking reelection. During his tenure in Congress, Hernández served on the Committee on Indian Affairs, the Agriculture Committee, and the Committee on Public Lands. He showed a special interest in the construction of an infrastructure for New Mexico, including bridges, reservoirs, dams, and public buildings.