Initial Margin for bilateral OTC Derivatives

Hi All,

I’m trying to understand the workflow of Initial Margin for bilateral OTC derivatives. When a new trade is executed then the CP has to post securities as initial margin. What happens to the securities during the life of the OTC derivative trade? When the trade is closed out does the pledged security get returned to the CP on settlement date?

Thanks!