Jeremiah received the LORD's word when Babylon's King Nebuchadnezzar and his army, and all the countries and people he ruled, were attacking Jerusalem and all its towns.
References for Jeremiah 34:1
The LORD, the God of Israel, proclaims, Go and speak to Judah's King Zedekiah and say to him: The LORD proclaims, I'm handing this city over to the king of Babylon, and he will burn it down.
You won't escape but will be captured and handed over to him. You will see the king of Babylon with your very own eyes and speak to him personally, and you will be taken to Babylon.
Even so, hear the LORD's word, King Zedekiah of Judah: This is what the LORD proclaims about you: You won't die in battle;
you will die a peaceful death. As burial incense was burned to honor your ancestors, the kings who came before you, so it will be burned to honor you as people mourn, "Oh, master!" I myself promise this, declares the LORD.
The prophet Jeremiah delivered this message to Judah's King Zedekiah in Jerusalem
when the army of the king of Babylon was attacking Jerusalem and all the remaining Judean towns, Lachish and Azekah—the only fortified towns still standing in Judah.
Jeremiah received the LORD's word after King Zedekiah had made a covenant with all the people in Jerusalem to proclaim liberty for their slaves:
everyone was to free their male and female Hebrew slaves and no longer hold a Judean brother or sister in bondage.
So all the officials and people who entered into this covenant agreed to free their male and female slaves and no longer hold them in bondage; they obeyed the king's command and let them go.
References for Jeremiah 34:10
But afterward they broke their promise, took back the men and women they had freed, and enslaved them again.
Then the LORD's word came to Jeremiah:
The LORD, the God of Israel, proclaims: I made a covenant with your ancestors when I brought them out of the land of Egypt, out of the house of slavery.
I said that every seventh year each of you must free any Hebrews who have been sold to you. After they have served you for six years, you must set them free. But your ancestors didn't obey or pay any attention to me.
Recently you turned about and did what was right in my sight; each of you proclaimed liberty for the other and made a covenant before me in the temple that bears my name.
But then you went back on your word and made my name impure; each of you reclaimed the men and women you had set free and forced them to be your slaves again.
Therefore, the LORD proclaims: Since you have defied me by not setting your fellow citizens free, I'm setting you free, declares the LORD, free to die by the sword, disease, and famine! And I will make you an object of horror for all nations on earth.
I will make those who disregarded my covenant, violating its terms that they agreed to in my presence, like the calf they cut in two and then walked between the halves of its carcass.
The officials of Judah and Jerusalem, the eunuchs and priests, and all the people who passed through the pieces of the calf
I will hand over to their enemies who seek to kill them. And their corpses will become food for birds and wild animals.
I will hand over Judah's King Zedekiah and his officials to their enemies who seek to kill them: namely, the army of Babylon's king, which has just withdrawn from you.
I'm about to issue orders, declares the LORD, that the army of Babylon return to this city. They will wage war against it, capture it, and burn it down along with other Judean cities. I will make Judah a wasteland, without inhabitants.