Periodic polarity (PePo) GaN films are grown by molecular-beam epitaxy. A high Mg doping is used to reverse the film polarity from Ga to N. An etching step is then performed to define the PePo pattern. Ultrasharp inversion domain boundaries between Ga- and N-polar domains are shown by transmission electron microscopy. Moreover, it is demonstrated that three-dimensional (3D) patterned Ga-polarity GaN films can be obtained from these PePo samples by a simple wet chemical etching procedure. When combined with a focused ion beam (FIB) to define the initial PePo template, periodic poling as well as chemical 3D patterning is demonstrated down to the nanometer scale. (c) 2005 American Institute of Physics.