High-speed solid state fluorination of Nb2O5 yields NbO2F and Nb3O7F with photocatalytic activity for oxygen evolution from water.