On January 10, 1781, the Second Continental Congress created the office of Secretary of Foreign Affairs to head a "Department of Foreign Affairs".
On July 27, 1789, George Washington signed a congressional bill into law reauthorizing an executive Department of Foreign Affairs headed by a Secretary of Foreign Affairs. Congress then passed another law giving certain additional domestic responsibilities to the new Department and changing its name to the Department of State and the name of head of the department to the Secretary of State, and Washington approved this act on September 15, 1789.
The new domestic duties assigned to the newly renamed department were receipt, publication, distribution, and preservation of laws of the United States, custody of the Great Seal of the United States, authentication of copies and preparation of commissions of executive branch appointments, and finally custody of the books, papers, and records of the Continental Congress including the Constitution itself and the Declaration of Independence.
The title of Secretary of State is British in origin. At the time of American independence, "Secretary of State" was a title given to senior members of the King's cabinet (e.g., "Secretary of State in Charge of Colonies"). The position of "Secretary of State of the United States" was thus intended to be the most general and important office in the U.S. government, after the Presidency.
Thanks for the background info.