Farnham represented District 43 in Elgin.
In a written statement, Farnham said: ""I have been battling serious health issues for a number of years and the coming months will require my full attention. The right thing to do for the people of the 43rd District is to make sure they have a dedicated, qualified and full-time advocate in our communities and in the State Capitol to represent their needs and concerns every day without distraction or interruption. They deserve nothing less."
Just days ago, federal agents searched Farnham's Elgin home and legislative office. U.S. Immigration and Custom's Enforcement conducted the searches, but did not disclose why Farnham is under investigation.
He ran unchallenged in Tuesday's primary and there is no Republican opponent.