The Messenger of Allah (sal Allahu alaihi wa sallam) said: “Man will be tested according to the strength of his faith: The stronger his faith, the more severe his trial, and the weaker his faith, the lighter his trial. The believer will be continually tested until he walks on earth with all his wrong actions forgiven.” [Bukhari]
Then Urwah got gangrene in his leg and al-Walid sent doctors to him who suggested that the leg should be amputated otherwise the gangrene would spread to the rest of his body and kill him. Urwah agreed.
The doctors asked Urwah whether he would drink intoxicants to ease the pain. He said, “Allah is testing me to see the extent of my patience. How could I go against His commands?”
The doctors began to remove his leg using a saw. When the saw reached the bone Urwah fainted, and when he came around, sweat was pouring down his face and he was repeating, “La ilah ill-Allah, Allahu akbar.”
When the operation was over he picked up his leg and kissed it, then said, “I swear by the One Who mounted me on you, I never used you to walk to any place of wrong action or to any place where Allah would not like me to be.”
Then he gave instructions that the leg should be washed, perfumed, wrapped in a cloth and buried in the Muslim graveyard. [Uddat as-Sabirin wa Dhakhirat ash-Shakirin by Ibn Qayyim al-Jawziyyah]