A simple method is described for the site-specific attachment of yellow fluorescent protein (YFP) to glass surfaces on length scales ranging from tens of micrometers to ca. 200 nm. 3-Mercaptopropyl(triethoxy silane) is adsorbed onto a glass substrate and subsequently derivatized using a maleimide-functionalized oligomer of ethylene glycol. The resulting protein-resistant surface is patterned by exposure to UV light, causing photochemical degradation of the oligo(ethylene glycol) units to yield aldehyde groups in exposed regions. These are covalently bound to N-(5-amino-1-carboxypentyl)iminoacetic acid, yielding a nitrilotriacetic acid (NTA)-functionalized surface, which following complexation with Ni(2+), is coupled to His-tagged YFP. Using scanning near-field photolithography, in which a UV laser coupled to a scanning near-field optical microscope is utilized as the light source for photolithography, it is possible to fabricate lines of protein smaller than 200 nm, in which the biomolecules remain strongly optically active, facilitating the acquisition of diffraction-limited fluorescence images by confocal microscopy.