Structures fabricated using focused electron beam-induced deposition (FEBID) have sloped sidewalls because of the very nature of the deposition process. For applications this is highly undesirable, especially when neighboring structures are interconnected. A new technique combining FEBID and focused electron beam-induced etching (FEBIE) has been developed to fabricate structures with vertical sidewalls. The sidewalls of carbon FEBID structures have been modified by etching with water and it is shown, using transmission electron microscopy imaging, that the sidewall angle can be tuned from outward to inward by controlling the etch position on the sidewall. A surprising under-etching due to the emission of secondary electrons from the deposit was observed, which was not indicated by a simple model based on etching. An analytical model was developed to include continued etching once the deposit has been removed at the exposed pixel. At this stage the secondary electrons from the substrate then cause the adsorbed water molecules to become effective in etching the deposit from below, resulting in under-etched structures. The evolution of the sidewall angle during etching has also been experimentally observed in a scanning electron microscope by continuously monitoring the secondary electron detector signal.