In the shadow of a mistake-filled effort to purge the state's voter rolls of noncitizens, Texas Secretary of State David Whitley delivered his resignation to the governor Monday afternoon just before the end of the legislative session.

Whitley needed two-thirds support from the state Senate to stay in his position, but despite expected support from all 19 Republicans, Democrats roundly disavowed his voter rolls investigation, the Austin American-Statesman reported. He resigned before a vote could take place.

The secretary of state is constitutionally required to leave if he is not confirmed by the end of a full legislative session, according to the Texas Tribune. Whitley had served since December.

David Whitley, who has resigned as Texas secretary of state, reported wrongfully questioned the citizenship of nearly 100,000 Texans. (Associated Press)

David Whitley, who has resigned as Texas secretary of state, reported wrongfully questioned the citizenship of nearly 100,000 Texans. (Associated Press)

TEXAS LAWMAKERS APPROVE GUN STORAGE SAFETY PROGRAM, SETTING UP POLITICAL TEST FOR GOVERNOR

Whitley’s office reportedly questioned the citizenship of around 98,000 Texans – many times in error. His investigation spawned three federal probes and a court ruling that ended his effort, the Austin American-Statesman reported.

Texas gubernatorial appointees typically have no issue getting Senate confirmation, the Texas Tribune reported.

Once a new secretary of state is appointed, their office can continue Whitley’s efforts ceased by court order, but the investigation must reorganize to avoid his mistakes, the Houston Chronicle reported.

Whitley's resignation letter read in part: “Thank you for giving me the opportunity to serve Texas. Working alongside the employees in the secretary of state's office, county election officials, and representatives of our #1 trading partner, Mexico, has been my distinct honor and privilege.”

CLICK HERE TO GET THE FOX NEWS APP

Neither Whitley nor Gov. Greg Abbott have commented on the resignation.