Jeremiah38:2

The declaration was given from the court of the prison as counsel to submit to Babylonian rule, because continued resistance would invite certain death. Those who remained in Jerusalem would die by sword and famine and disease, while those who surrendered to the Chaldeans would live and preserve their lives. Its warning was plain and positive, clear and direct.

It belongs to the account demonstrating faithful integrity, in which the prophet was cast into a pit but God brought him out and caused his case to find favor with the princes.