Rav Chanan bar Rava said in the name of Rav: Ten years our father Abraham was imprisoned, three in Cuta and seven in Kardo. And Rav Dimi of Nehardea taught the reverse. Rav said: The lesser ferry-crossing of Cuta, that is Ur of the Chaldees. This is what is written: "For what great nation is there that has God so near to it" (Deuteronomy 4:7). By the way of the world, flesh and blood takes for himself a patron who will stand surety for him, and then the man is seized in chains. People go and tell the patron, "Your dependent has been seized." He says to them, "I stand surety for him." When the man is led out to be killed, where is he and where is his patron? But the Holy One, blessed be He, is not so. The ministering angels said, "Abraham, the son of your covenant, has been seized." He said to them, "I stand surety for him." They said to Him, "Behold, he stands before Amraphel" [text uncertain regarding his accusers being read out], "behold, he is being led out to be burned." He said to them, "I stand surety for him." He was cast into the fiery furnace, and the Holy One, blessed be He, came down and rescued him: "I am the LORD who brought you out of Ur of the Chaldees" (Genesis 15:7).
Abraham Imprisoned and Then Rescued by God From Ur of the Chaldees
Yalkut Shimoni on Torah 77:3
אָמַר רַב חָנָן בַּר רָבָא אָמַר רַב, עֶשֶׂר שָׁנִים נֶחְבַּשׁ אַבְרָהָם אָבִינוּ שָׁלוֹשׁ בְּכוּתָא, שֶׁבַע בְּקַרְדוֹ וְרַב דִימִי מִנְּהַרְדְּעָא מַתְנֵי אִפְּכָא אָמַר רַב, עִיבְּרָא זְעִירָא דְכוּתָא זֶה הוּא אוּר כַּשְׂדִּים. הֲדָא הוּא דִּכְתִיב, (דברים ד, ז) "כִּי מִי גּוֹי גָּדוֹל אֲשֶׁר לוֹ אֱלֹהִים קְרוֹבִים אֵלָיו". בְּנֹהָג שֶׁבָּעוֹלָם, בָּשָׂר וָדָם עוֹשֶׂה לוֹ פַּטְרוֹן שֶׁיְּהֵא מִתְקַיֵּם עָלָיו, וְהוּא נִתְפַּס בָּאַנְקְלִיטִין הָלְכוּ וְאָמְרוּ לוֹ נִתְפַּס בֶּן בֵּיתְךָ, אָמַר לָהֶם, אֲנִי מִתְקַיֵּם עָלָיו יָצָא לֵיהָרֵג, הֵיכָן הוּא וְהֵיכָן פַּטְרוֹנוֹ אֲבָל הַקָּדוֹשׁ בָּרוּךְ הוּא אֵינוֹ כֵּן. אָמְרוּ מַלְאֲכֵי הַשָּׁרֵת, נִתְפַּס אַבְרָהָם בֶּן בְּרִיתְךָ. אָמַר לָהֶם, אֲנִי מִתְקַיֵם עָלָיו. אָמְרוּ לוֹ, הֲרֵי הוּא עוֹמֵד לִפְנֵי אַמְרָפֶל, הֲרֵי אַפּוּמְנִימָא שֶׁלּוֹ נִקְרָאִין הֲרֵי הוּא יוֹצֵא לִישָּׂרֵף. אָמַר לָהֶם, הֲרֵינִי מִתְקַיֵּם עָלָיו. הֻשְׁלַךְ לְכִבְשַׁן הָאֵשׁ, יָרַד הַקָּדוֹשׁ בָּרוּךְ הוּא וְהִצִּילוֹ, אֲנִי ה' אֲשֶׁר הוֹצֵאתִיךָ מֵאוּר כַּשְׂדִּים.