The high optical gain and absorption of organic–inorganic hybrid perovskites have attracted attention for photonic device applications. However, owing to the sensitivity of organic moieties to solvents and temperature, device processing is challenging, particularly for patterning. Here, we report the direct patterning of perovskites using chemically gas-assisted focused-ion beam (GAFIB) etching with XeF2 and I2 precursors. We demonstrate etching enhancement in addition to controllability and marginal surface damage compared to focused-ion beam (FIB) etching without precursors. Utilizing the GAFIB etching, we fabricated a uniform and periodic submicron perovskite subwavelength grating (SWG) absorber with broadband absorption and nanoscale precision. Our results demonstrate the use of FIB as a submicron patterning tool and a means of providing surface treatment (after FIB patterning to minimize optical loss) for perovskite photonic nanostructures. The SWG absorber can be patterned on perovskite solar cells to enhance the device efficiency through increasing light trapping and absorption.