Hybrid lithium-ion capacitors (LICs) are promising energy storage systems which could deliver higher energy density without compromising the high power and cycle life of supercapacitors. WO3 is an appealing anode material for LICs due to its high theoretical capacity of 696 mA h g-1 for Li+ storage. However, the practical implementation of WO3 in LICs is limited by its low conductivity, sluggish kinetics and large volume changes during cycles. Herein, we report a "hitting three birds with one stone" strategy for the synthesis of heterogeneous phosphorus-doped WO3-x/N-doped carbon (P-WO3-x/NC) nanowires, which are prepared via the calcination of organic-inorganic hybrid WO3/ethylenediamine(EDA) nanowires in Ar and subsequent thermal phosphorization. The EDA molecules are carbonized into a 1D NC matrix and WO3 layers are converted into P-WO3-x nanocrystals which are in situ embedded in the continuous 1D NC matrix forming a well-defined 0D-in-1D hybrid structure. The small P-WO3-x nanocrystals offer short paths for Li+ diffusion and the continuous NC matrix facilitates electron transport and buffers the volume change of P-WO3-x during discharging/charging. The oxygen vacancies and P heteroatoms with smaller electronegativity result in enhanced electrochemical activity due to the higher degree of covalent bonding and sharing electrons. The P-WO3-x/NC nanowires are expected to act as high-performance anodes for LICs with high capacity, high rate and long life via the synergistic effect of P dopants and oxygen vacancies as well as the in situ formed conductive carbon matrix. Our results show that the P-WO3-x/NC nanowire electrode delivers a high capacity of 490 mA h g-1 at 1 A g-1 and a high rate capacity of 230 mA h g-1 at 3.2 A g-1. Moreover, the P-WO3-x/NC nanowires exhibit excellent cycle reversibility with 96.2% capacity retention over 2000 cycles at 1 A g-1. A 4.3 V LIC prototype composed of the P-WO3-x/NC anode with a commercial activated carbon cathode shows an ultra-high energy density of 195.58 W h kg-1 at 597.2 W kg-1 with 90.7% retention over 6000 cycles. These promising results provide fundamental insight into the synthesis of high-performance electrode materials for advanced electrochemical energy storage.