He made himself low before God, and  God let him come back to his kingdom.

Repent; God’s mercy is greater than his vengeance

2 Chronicles 33:12
And crying out to the Lord his God in his trouble, he made himself low before the God of his fathers,

2 Chronicles 33:13
And made prayer to him; and in answer to his prayer God let him come back to Jerusalem and to his kingdom. Then Manasseh was certain that the Lord was God.

God, Manasseh, Assyrian king, Amon, Josiah.