Damond Hampton faces three counts of predatory criminal sexual assault.
The charges stem from an incident Monday in the Walker branch of the library in the Morgan Park neighborhood, in which an 11-year-old girl was sexually assaulted, police said.
The girl's mother left the room the child was in at the library in the 11000-block of South Hoyne Avenue about 4 p.m. Monday, according to police. That was when a man in his mid-20s reportedly entered the room, sat next to the 11-year-old and started talking to her.
The man then sexually assaulted the girl and fled on foot, police said.
Police arrested Hampton shortly after the incident on Monday.
The victim was transported to Little Company of Mary Hospital and Health Care Centers in Evergreen Park. She remained stable, according to police.
Police have said the suspect in the case was previously asked to leave the library because his erratic behavior was making some patrons uncomfortable. However, the library, which has resources everyone is entitled to, cannot legally ban anyone from using it.
In a statement, the library said: "We take patron safety very seriously, and will continue to cooperate with law enforcement on this matter."