Injectable materials often have shortcomings in mechanical and drug-eluting properties that are attributable to their high water contents. A water-free, liquid four-armed PEG modified with dopamine end groups is described which changes from liquid to elastic solid by reaction with a small volume of Fe3+ solution. The elastic modulus and degradation times increase with increasing Fe3+ concentrations. Both the free base and the water-soluble form of lidocaine can be dissolved in the PEG4-dopamine and released in a sustained manner from the cross-linked matrix. PEG4-dopamine is retained in the subcutaneous space in vivo for up to 3 weeks with minimal inflammation. This material's tailorable mechanical properties, biocompatibility, ability to incorporate hydrophilic and hydrophobic drugs and release them slowly are desirable traits for drug delivery and other biomedical applications.