Detectives were able to check who was in the area of the primary school at the time of the attack on March 1, by tracing transmissions from mobile phones.
The man is thought to have entered the school, which is in the Wedding district of Berlin, at 10am, where he locked himself in the toilet with the girl, undressed her, and sexually abused her before making his escape.
DNA samples were collected from the girl's clothes, allowing police to narrow down their search.
The suspect, 30, remains unnamed but police confirmed in a statement that they already knew of him. He was thought to own a large dog and had many dangerous knives in his apartment – prompting the involvement of police commandos.
Mums and dads of children at the school have been patrolling the building and playgrounds since the attack while improved security measures are to be installed during the Easter holidays.
The police announced a similar attack this week. A man is thought to have sexually abused another schoolgirl in a school in the Frohnau district of the capital on March 7.