lloyd was elected as a federalist to the united states senate to fill the vacancy caused by the resignation of john henry and served from december 8, 1797 until december 1, 1800, when he resigned. on june 27, 1798, lloyd introduced the sedition act of 1798, a part of the alien and sedition acts.