What's your nationality? Different countries have their own variations on passport law so this could have an impact on your situation.
Generally speaking, a passport can only be confiscated if a person is detained by immigration or arrested. This is briefly outlined here (click to follow link) on the website for SA Dept of Foreign Affairs - in this case, reference is being made specifically to South African passports in other countries, not the other way around (which seems to be your case). But I would think the same broad principles would apply.
I'd suggest getting in touch with the local embassy of your home country. They should be able to give you some advice.