Cook County Sheriff’s deputies serving an eviction notice to a South Side man walked in on him having sex with a 15-year-old girl he met on the “SayHi” app, prosecutors said Thursday.

Solomon Muhammad-Ali met the girl on Sept. 9 and exchanged sexually explicit pictures with her. She has the cognitive functioning age of a 6-year-old, Assistant Cook County State’s Attorney Becky Walters told Judge Peggy Chiampas. He was charged with aggravated criminal sexual abuse, according to court records.

She initially told Muhammad-Ali she was 18, but then admitted she was 15.

Still, 34-year-old Muhammad-Ali spoke to her over the phone, and the girl stayed with him last weekend, Walters said.

On Tuesday, when sheriff’s deputies went to serve Muhammad-Ali an eviction notice, they found him and the girl naked in the apartment in the 1600 block of West 83rd, authorities said.

The girl was performing a sex act on Muhammad-Ali, Walters said.

The girl told deputies she had had sex with Muhammad-Ali before and that she was 15, Walters said.

Evidence technicians recovered a condom wrapper; a condom wrapper with a open condom inside; two cellphones; and a pair of the girl’s underwear that was placed in a backpack at Muhammad-Ali’s residence, Walters said.

The girl was taken to University of Chicago Comer Children’s Hospital, where a rape kit was taken.

Muhammad-Ali allegedly told police the girl told him she was 15, and he asked her to leave, but they had sex anyway.

“I messaged her ‘hi’ and she messaged me back, and I asked her to call me and she did,” Muhammad-Ali told officers, according to his police report.

Muhammad-Ali had been out on bond for a 2013 aggravated domestic battery and strangulation case involving his ex-girlfriend, Walters said.

He has three previous misdemeanor domestic battery convictions and one misdemeanor battery conviction, Walters said.

An assistant public defender said Muhammad-Ali is a cook at an area fast-food chain.

Chiampas ordered him held without bail.