Using the first-principles method based on the density functional theory, we have studied magnetic and optical properties of V-doped GaN. For 12.5% V-doped GaN, total energy calculations show that the ferromagnetic state is 255meV lower than the antiferromagnetic state and is thus predicted to be the ground state with a Curie temperature above room temperature. The magnetic moments are localized at the V atoms and ferromagnetic exchange interaction is short ranged. The analysis of optical properties shows that V-doped GaN is a promising dielectric material and has potential applications in optoelectronic devices.