When the people returned, they were shocked to see their gods smashed to pieces, lying scattered all over the temple. They began to guess who had done that to their idols, and Abraham's name came to their minds.
Allah the Almighty said: They said: "Who has done this to our aliah (gods)? He must indeed be one of the wrongdoers." They said: "We heard a young man talking (against) them who is called Abraham." They said: "Then bring him before the eyes of the people, that they may testify." They said: "Are you the one who has done this to our gods, 0 Abraham?" (Abraham) said: "Nay, this one, the biggest of them (idols) did it. Ask them, if they can speak!"
So they turned to themselves and said: "Verily, you are the Zalimun (polytheists and wrong-doers)." Then they turned to themselves (their first thought and said). "Indeed you (Abraham) know well that these (idols) speak not!" (Abraham) said: "Do you then worship besides Allah, things that can neither profit you, nor harm you? Fie upon you, and upon that which you worship besides Allah! Have you then no sense?" Surah 21: 59-67
Furious, they demanded that Abraham be arrested and tried. Abraham did not resist. This was precisely what he had been aiming for, so that he could show them up in public for their foolish beliefs.
At the trial they asked him if he was responsible for breaking the idols. Smiling, he told them to ask the biggest idol, which was still whole. He told them that he must be the culprit! They replied that he knew well that the idol could not speak or move, which gave Abraham the chance to prove the foolishness of worshipping these lifeless objects.
They then realized the senselessness of their beliefs; however, their arrogance would not allow them to admit their foolishness. All they could do was use their power of authority - as tyrants usually do - to punish Abraham. They kept him in chains and planned their revenge.