Purpose: Current IMRT planning for moving targets involves treatment margin expansion, gating, and tracking targets. However, treatment time is significantly increased when using gating and tracking in treatments, and substantially more dose is delivered using the target margin expansion method. In this study, we suggest a 4D IMRT inverse planning method using a spatial‐temporal compressed sensing (CS) technique, which aims to overcome limitations of the previous methods. This proposed method intends to provide a significant benefit in treatment time and target dose uniformity. Method and Materials: A 3D CS IMRT inverse planning technique was extended to 4D by including a spatial‐temporal total‐variation (TV) constraint. It utilizes a piecewise‐constant condition of the beamlet intensity maps to reduce the map complexity and includes a temporal constraint for penalizing multi‐leaf collimator motion. To demonstrate the proposed algorithm, we used a digital phantom with 7 phases, and a simulated lung malignancy case with 2 different target positions. To compare to 4D treatment planning, a 3D optimization of each individual phase employed a TV algorithm and combined all phases on the reference phase. All algorithms included field‐specific numbers of segment for a clinical feasibility test. Results and Discussion: The dose volume histogram and the dose distribution maps on the reference phase image were obtained from the study. Significant improvement of uniformity in target dose and sparing of the organ at risk was demonstrated by the 4D IMRT planning, indicating the benefits of including temporal information. Enhancing the piecewise‐constant condition using a spatial‐temporal constraint maintains the uniformity of the dose distribution and reduces the complexity of the fluence maps, making plans deliverable in clinics. Conclusion: The study demonstrated the feasibility of 4D IMRT inverse planning using the CS technique. This technique provides clinically applicable / deliverable plans.