Company forcing employee to sign non compete document at the time of exit and not giving reliving le

I have resigned my company which was duly acknowledged and also my last working day was communicated and I also served full 90 days notice period. all went smooth, just 15days before my last working day , the company acted weird and suddenly put false allegation and termination drama , sent me notice to attend enquiry and I attended and asked me to show proof , which they didn't have and said will show when required. later they couldn't do much and asked me off the record to sign that I will not do in the future about the allegations,i didn't sign since I didn't do any wrong in the first place. next after few days they said tomorrow is my last working day and I should complete exit formalities , only to know the next day it was revoked and citing mistakenly sent as the reason, when approached they asked me to sign that I will not join few companies and again this is off the record conversation and if not I should take back my resignation. I said no to both , now on the last working day the HR asking me to sign an agreement which is more of non compete clause, if I sign I will not be able to join any company for a period of 18months, since I didn't sign the agreement they are not providing me releiving letter. however I had got no dues from all department. except HR as he said I have to sign this document then only he will consider no dues. need help