Despite claiming to be 15 and 16 when they applied for asylum, according to dental records the two alleged attackers are over 18.
The men are said to have attacked the boy at a centre in Alvesta, Smaland, and reportedly filmed the sexual assault on a mobile phone.
On Facebook, the men claim to be born in 1997 and the other 1971, one of the men also wrote that he has previously worked as a mechanic in Dubai.
Prosecutor, Emma Berge, said the second man was not 45 but was over 18.
She said: “A dental examination with an age assessment had been made by the National Board of Forensic Medicine, and then there is information from Facebook and similar sources.
“And then you also have to look at their appearance and how they are perceived.”
The alleged attack took place at a government-provided housing centre for underaged unaccompanied migrants and refugees in Smaland county.
The housing is supposed to be for people in their late teens.
According to the Swedish newspaper, Expressen, the alleged rape took place outside, near the housing, in the beginning of January.
It has been claimed that the boy was beaten and then raped by both men.
The first rape was allegedly filmed by one man and then sent to the second man”s mobile phone.
One of the suspects shared a room with the 12-year-old boy at the time of the alleged sexual assault.
Both men have been charged with raping a child and also face child pornography allegations.
They deny all charges.