[This is] the word that came to Jeremiah from the Lord after Nebuzaradan, captain of the guard, released him at Ramah when he had been bound in chains with all the exiles of Jerusalem and Judah who were being exiled to Babylon.
References for Jeremiah 40:1
The captain of the guard took Jeremiah and said to him, "The Lord your God decreed this disaster on this place,
and the Lord has fulfilled [it]. He has done just what He decreed. Because you [people] have sinned against the Lord and have not obeyed Him, this thing has happened.
Now pay attention [to what I say]. Today I am setting you free from the chains that were on your hands. If it pleases you to come with me to Babylon, come, and I will take care of you. But if it seems wrong to you to come with me to Babylon, go no farther. Look-the whole land is in front of you. Wherever it seems good and right for you to go, go there."
References for Jeremiah 40:4
When Jeremiah had not yet turned [to go, Nebuzaradan said to him:] "Return to Gedaliah son of Ahikam, son of Shaphan, whom the king of Babylon has appointed over the cities of Judah, and stay with him among the people or go wherever you want to go." So the captain of the guard gave him a ration and a gift and released him.
References for Jeremiah 40:5
Jeremiah therefore went to Gedaliah son of Ahikam at Mizpah, and he stayed with him among the people who remained in the land.
References for Jeremiah 40:6