Socrates official formal accusation was in 399 BCE, he was brought in to the jury by Meletus a man that was embarrassed while being interrogated by Socrates. Meletus reasoning for Socrates formal accusation was the he was charged for not recognizing the gods recognized by the state, introducing others, new divinities and corrupting the youth (The Apology).
Plato account of Socrates trial is noted in “The Apology” speech Socrates made during his trial. The speech that Socrates made was appropriate, he gave us an understanding in his reasoning why he felts he wasn’t doing any wrong in his teachings of virtue and by him pleading to the jury in a detailed speech that would make the jury try to understand his morals reasons. Socrates tried to save himself, but given the fact that a war was going on the people were much more sensitive, and even though he plead to the jury, my assumption is that he knew that he would be put to death, especially giving the fact that he asked for a lesser charge that he knew he would have no chance in getting.
However, I also believe that Socrates was also giving us a moral lesson during his speech to the citizens of Athens? During his trial Socrates spoke to his audience in a casual familiar manner he used to explain his virtues to others as well as explain that he indeed was a wise man himself, and the fact that at the end when he explained that those who accused and not believed in him after he is put to death are the ones who are to blame for his non-existence (Apology).