The 17th Amendment to the US Constitution was passed by Congress on May 13, 1912 and was ratified on April 8, 1913. It replaced the selection of US Senators by the state legislatures with a provision for the direct election of senators.
Text of the 17th Amendment
The Senate of the United States shall be composed of two Senators from each State, elected by the people thereof, for six years; and each Senator shall have one vote. The electors in each State shall have the qualifications requisite for electors of the most numerous branch of the State legislatures.
When vacancies happen in the representation of any State in the Senate, the executive authority of each State shall issue writs of election to fill such vacancies: Provided That the legislature of any State may empower the executive thereof to make temporary appointments until the people fill the vacancies by election as the legislature may direct.
This amendment shall not be so construed as to affect the election or term of any Senator chosen before it becomes valid as part of the Constitution.