Using Finite-Difference Time-Domain (FDTD) simulation, we show that ultrahigh-Q nanocavities can be obtained through the manipulation of a single semiconductor nanowire (NW) inside a slot in a line defect of a two-dimensional (2D) photonic crystal. By controlling the design and its lattice parameters of the photonic crystal, we have achieved a quality factor Q larger than 10 6 and a mode volume V c smaller than 0.11 µm 3 (1.25 of a cubic wavelength in the NW) for a cavity peak in the telecommunication band. This design is useful for realizing a position-controlled cavity in a photonic crystal. Here we also discuss the small dependence of the Qfactor, the V c , and the cavity peak in relation to the position of the NW inside the slot and the potential application to the cavity quantum electrodynamics (QED) using the embedded-emitter NW.