In 399 BC The Athenian public court was induced by three leading public figures to try Socrates for corrupting the minds of the young by teaching them to question anything, and of atheism; believing in supernatural things of his own invention instead of the gods recognised by the State. Hidden behind these accusations was the ego of the elite, who resented Socrates because their reputations for wisdom and virtue were debunked by him.
By a very narrow margin, the jury of 501 Athenians found him guilty. Next, Socrates and his prosecutor
suggested competing sentences. Socrates openly mocked the court and jokingly suggested free meals
at the Prytaneum, but then finally settled on the insultingly small fine of thirty minae.
Socrates' belief in the purity and goodness of the soul is truly revealed when he responds to his verdict. He accepts the verdict with composure, as he had anticipated this. Socrates tells the jury that he cannot be harmed by the so-called punishment of death. It is only his physical body that can die, but his true nature is an eternal soul made of purity and goodness. His soul cannot be vanquished. He makes it clear that despite the court's verdict he will not resort to dramatic emotions or petition to live even a little longer.
"To fear death, my friends, is only to think ourselves wise, without being wise: for it is to think that we know what we do not know. For anything that men can tell, death may be the greatest good that can happen to them: but they fear it as if they knew quite well that it was the greatest of evils. And what is this but that shameful ignorance of thinking that we know what we do not know?"
See Plato's Apology for the trial. Socrates has been revered since his execution as a beacon of free speech. The execution was delayed for a month so he had ample time to escape. Socrates's followers encouraged him to flee (see: Crito), and indeed the city fathers expected this and were probably not averse to it; but he refused on principle and took the poison hemlock himself. Apparently in accordance with his philosophy of obedience to law, he carried out his own execution, by drinking the hemlock poison provided to him. He was, thus, one of the first of a limited number of strictly intellectual "martyrs". Socrates died at the age of 70. (See: Phaedo) As Plato describes it, Socrates' last day on earth was spent discussing the the question of the immortality of his soul with his friends Cebes and Simmias.
There's a story of Chaerephon, who went to the Oracle at Delphi, to ask if anyone in the land was wiser than Socrates. When Chaerephon reported to Socrates that the god told him there is none wiser, Socrates saw this as a "divine mission" to find someone wiser than himself.