Narrated Abu Huraira (ra):
When Khaibar was conquered, a roasted poisoned sheep was presented to the Prophet (sas) as a gift (by the Jews). The Prophet ordered, "Let all the Jews who have been here, be assembled before me." The Jews were collected and the Prophet (sas) said (to them), "I am going to ask you a question. Will you tell the truth?" They said, "Yes."
The Prophet (sas) asked, "Who is your father?" They replied, "So-and-so." He said, "You have told a lie; your father is so-and-so." They said, "You are right." He said, "Will you now tell me the truth, if I ask you about something?" They replied, "Yes, O Abu Al-Qasim; and if we should tell a lie, you can realize our lie as you have done regarding our father." On that he asked, "Who are the people of the (Hell) Fire?" They said, "We shall remain in the (Hell) Fire for a short period, and after that you will replace us." The Prophet (sas) said, "You may be cursed and humiliated in it! By Allah, we shall never replace you in it." Then he asked, "Will you now tell me the truth if I ask you a question?" They said, "Yes, O Abu Al-Qasim." He asked, "Have you poisoned this sheep?" They said, "Yes." He asked, "What made you do so?" They said, "We wanted to know if you were a liar in which case we would get rid of you, and if you are a prophet then the poison would not harm you."
Verily a Jewish woman presented poisoned (meat of) a she goat to the apostle of Allah. He took a piece from it, put it into his mouth, chewed it and threw it away. Then he said to the Companions: "Stop! Verily, its leg tells me that it is poisoned." Then he sent for the Jewish woman and asked her; "What induced you to do what you have done?" She replied, "I wanted to know if you are true; in that case Allah will surely inform you, and if you are a liar I shall relieve the people of you."
Narrated 'Aisha (ra): The Prophet in his ailment in which he died, used to say, "O 'Aisha! I still feel the pain caused by the food I ate at Khaibar, and at this time, I feel as if my aorta is being cut from that poison."
Source: Sahih Bukhari
Prophet Muhammed (sas) was marytr because of poison. Allah (swt) showed its effect before death to give Prophet Muhammed (sas) position of marytr.