Background: Determining the cost structure of medical care from diagnosis to the death of patients with cancer is crucial for establishing budgets to support patients with cancer. The breakdown of the cost estimation in distinct phases of survival is essential for optimizing the allocation of limited funds. Therefore, this study aims to examine the patterns of direct medical costs of cancer care associated with seven major cancer types and estimate cost thresholds to distinguish each phase based on the incurred cost. Methods: In this nationwide, population-based study, we used claims data from the National Health Insurance Service, Korea. Patients newly diagnosed with cancer since 2006 and who died in 2016-2017 were enrolled, and their use of medical services during cancer survival from at least 6 months up to 12 years was observed. The monthly cost exhibited a non-linear function with two unknown thresholds resembling a U-shape; therefore, we fitted three linear segment models. Individual costs were assessed by dividing the survival time into the initial, continuing, and terminal phases by estimated thresholds, and the average medical cost for each phase was calculated. Results: Based on survival durations of 12 years or less, the initial phase occurred within 1.1-4.8 months after diagnosis, while the terminal phase was observed in 1.4-4.7 months before death. The length of these two phases increased with the increased survival time of the patients. Medical costs in these phases ranged from $4067-7431 and $3127-6114 (US dollars), respectively, regardless of the variations in survival time. However, the average costs in the continuing phase were higher for patients with a short survival time. Conclusions: This study highlights the cost dynamics in cancer care through a breakdown of the phases of survival. It suggests that through a more refined definition of the initial and terminal phases, the average cost in these stages increases, indicating the significant implications of the findings for resource allocation and tailored financial support strategies for patients with cancer with varying prognoses.