This question already has an answer here:
At the beginning of DS9 Season 6, the Dominion (including the Jem Ha'dar and the Cardassians) took DS9. At this time Bajor was neutral and in a non-aggression treaty with the Dominion.
How was this justified? Given Kira's and Odo's (reluctant) initial acceptance of this occupation and willingness to collaborate with it, it seemed that this occupation was legitimate. How could it be? Shouldn't Bajor control the station? As a neutral power, doesn't giving access to an important base violate the neutrality? At best, the Dominion could only be a guest in the station, but it looks like they are running the station.