Abstract. The main purpose of this paper is to present a natural method of decomposition into special cubes and to demonstrate how it makes it possible to efficiently achieve many well-known fundamental results from quasianalytic geometry as, for instance, Gabrielov's complement theorem, o-minimality or quasianalytic cell decomposition.This paper deals with certain families of quasianalytic Q-functions as well as the corresponding categories Q of quasianalytic Q-manifolds and Qmappings. Transformation to normal crossings by blowing up applies to such Q-functions (as discovered by 3] and Rolin-Speissegger-Wilkie [13]), and thence to Q-semianalytic sets. This gives rise to the geometry of Q-subanalytic sets, which are a natural generalization of the classical subanalytic sets.Our main purpose is to present a decomposition of a relatively compact Q-semianalytic set into a finite union of special cubes, and of a relatively compact Q-subanalytic set into a finite number of immersion cubes. The former decomposition combines transformation to normal crossings by local blowing up (developed in [1,3]) and a suitable partitioning; together with the method of fiber cutting, it yields the latter decomposition. Decomposition into special cubes will also become a basic tool in our subsequent paper [11] concerning quantifier elimination and the preparation theorem in quasianalytic geometry.We apply decomposition into immersion cubes in our proof of Gabrielov's complement theorem for the case of Q-subanalytic sets. These two results both imply that the expansion R Q of the real field by restricted quasianalytic Q-functions is an o-minimal polynomially bounded structure with exponent 2000 Mathematics Subject Classification: Primary 14P15, 32B20, 26E10; Secondary 32S45, 03C64.