The Seder HaDoros (“R’ Akiva”-#11) cites the Eimek HaMelech and the Chesed L’Avraham (see also the Rama MiPhano’s Gilgulei Neshamos (“Kazbi”)) that R’ Akiva was a gilgul of Zimri, the nassi from the tribe of Shimon who was killed by Pinchas after contributing to the death of 24,000 Jews. R’ Akiva subsequently taught 24,000 talmidim who were supposed to serve as a tikkun for those who had sinned generations before. See also Sefer HaGilgulim (chapter 67) that the gematria of “Akiva ben Yosef” (with the osiyos) equals that of “Zimri ben Salu.” There are other associations as well. (Let us not forget that, although we might regard Zimri as having openly disgraced G-d’s name, he did, in fact, possess many ma’alos— see R’ M. Wolfson’s Emunas I’techa, beginning of parshas Pinchas, where he addresses this issue.) See also Megaleh Amukos who traces R’ Akiva back even further— to the father and origin of Zimri’s tribe, Shimon himself, who killed 24,000 in the city of Shechem to avenge Dinah’s abduction. Pinchas, many opinions in Chazal claim (see the sources cited in the footnotes towards the end of my essay on parshas Toldos), was Eliyahu HaNavi, becoming transformed- according to Pirkei d’R’ Eliezer (chapter 47)- directly as a result of his zealous killing of Kazbi and Zimri.
It all now seems quite fascinating: R’ Akiva, some opinions believe, was a reincarnate of Zimri. Zimri was killed by Pinchas, the one who then became Eliyahu as a direct result of his act of kana’us. After being misakein the deficiencies of Zimri, the now completed soul of R’ Akiva/Zimri is carried heavenward by none other than Eliyahu, the Pinchas turned Eliyahu who had earlier acted aggressively against it. Only now that same Pinchas comes to give testimony to this corrected and purified soul by according it the greatest honor of personally bringing it to the realm where it will then take on eternal life…(Perhaps this is somewhat similar to the Pirkei d’R’ Eliezer (chapter 29) regarding the same Eliyahu who, after being mikaneh against the Jews regarding bris milah, is then told by HaKB”H that he must therefore be present at every subsequent bris performed as witness to the “tikkun.”)