Reports that federal agents were looking for evidence of child pornography when they seized computers from the Elgin district office of former state Rep. Keith Farnham shocked local officials who said the lawmaker was well-liked and active in the community.

"I couldn't even fathom it. I was stunned," said former Elgin Mayor Ed Schock, adding that Farnham always worked on the city's behalf.

Farnham has not been accused of any crime.

Federal agents were searching for documents "pertaining to the possession, receipt or distribution of child pornography" as well as computer files, copies and negatives of child pornography or any documents that depicted minors "engaged in sexually explicit conduct," according to a search warrant released Friday.

Farnham, 66, a Navy veteran who ran a painting business in Elgin before running for office, announced his resignation Wednesday, saying he had been "battling serious health issues for a number of years." He won the Democratic primary the day before, running unopposed.

Farnham told the Tribune on Monday that he is receiving treatment for bladder cancer but that his main struggle is with pulmonary fibrosis, a condition that causes lung tissue to scar.

He declined to comment further on his resignation and the federal investigation.

Elgin Mayor David Kaptain, who referred to Farnham as a close friend, said he knew of the former representative's fight with cancer over the past few years — a battle the two had in common.

"He and I were both at a point where we were starting to move on … kind of having it under control probably two or three months ago," Kaptain said.

"I've worked well with him since he's been in the state legislature and I'm sorry to hear that he has problems."

Kane County Board member Joseph Haimann, D-Carpentersville, said he was surprised to learn about the investigation.

"If you talk to anybody, they all have nothing but good to say about him," Haimann said. "I thought very highly of him."

Farnham joined the General Assembly in 2009 to represent the 43rd District, which includes parts of Elgin, Carpentersville, East Dundee and South Elgin.

Before running for office, he worked as a painting contractor all over the Chicago area. In the early 2000s he served as president of the Finishing Contractors Association of Chicago board of directors.

In the late 2000s he was honored by the city of Elgin for preserving two buildings — 216 Prairie St. and the historic Elgin Dairy warehouse, which he converted into loft homes, according to the state House Democrats website.

While in office, Farnham worked on securing grant money for projects to revitalize the riverfront in Elgin, which straddles the Fox River, Schock said.

He also worked with Elgin leadership to introduce legislation that enabled law enforcement agencies to recover costs incurred during drug investigations from convicted drug dealers and to allow municipalities to better compete for grant money to combat gang violence. The two bills were signed into law in 2011.

"He was always working hard on behalf of the city and our social service agencies and sometimes working to prevent bad legislation that would affect our city," Schock said.

Over the past year, Farnham voted in favor of a pension overhaul, gay marriage and medical marijuana. He also voted for concealed carry of firearms and on the successful override of Quinn's veto that put the law into place.

Democratic leaders from the area will choose a replacement for Farnham for the November election. No Republican candidate has stepped forward for his seat.

"We're going to move forward. We have some good people who can walk right into that post," said Kane County Democratic Party Chairman Mark Guethle.

Tribune reporters Ray Long and Maura Zurick and freelance reporter Jamie Greco contributed.

sbaer@tribune.com

Twitter @skbaer