The Talmud, Taanit 29a as translated by https://halakhah.com/pdf/moed/Taanith.pdf
When Turnus Rufus the wicked destroyed 20 the Temple, R. Gamaliel was condemned to death. A high officer came and stood up in the Beth-Hamidrash and called out, ‘The Nose-man 21 is wanted, the Nose-man is wanted’. When R. Gamaliel heard this he hid himself. Thereupon the officer went up secretly to him and said, ‘If I save you will you bring me into the world to come?’ He replied: Yes. He then asked him, ‘Will you swear it unto me?’ And the latter took an oath. The officer then mounted the roof and threw himself down and died. Now there was a tradition [amongst the Romans] that when a decree is made and one of their own [leaders] dies, then that decree is annulled. 22 Thereupon a Voice from Heaven was heard declaring, This high officer is destined to enter into the world to come.
Rav Yitzchak Zylberstein in Chashukei Chemed to Sanhedrin 74b derives a controversial halachic principle from the above story. But since he ends off his analysis by stating that the matter needs further investigation at this point in time vilnagaon.org will provide no further details.
Appendix 1: For further background on this subject see:
- Kitzur Shulchan Aruch on How Should We View A Person Who Committed Suicide & Other Wicked People That Died
- Do Gentiles Have a Share in the World to Come?
- The Jewish View on Heaven and Hell
- Experiences of People who were clinically dead and came back to life