To provide a photocrosslinkable compound and a photocrosslinking agent which are capable of ligation of nucleic acids within a short period of time compared to the conventional cases, and to which modifications depending on the intended use can easily be made, and a method of producing the photocrosslinking agent. Nucleic acids including a group represented by the formulae I, III, IV, or V as a nucleobase; a photocrosslinking agent including the nucleic acids, a method of producing nucleic acids by reacting nucleic acids including a group represented by the formulae VI, VII, VIII, or IX as a nucleobase with an aromatic azidated product represented by the formula X.