BACKGROUND: Lung cancer ranks as one of the leading causes of cancer diagnosis and is the foremost cause of cancer-related mortality worldwide. The early detection of lung nodules is important in improving outcomes for patients, as it enables timely and effective treatment interventions. The segmentation of lung nodules plays a critical role in aiding physicians in distinguishing between malignant and benign lesions. However, this task remains challenging due to the substantial variation in the shapes and sizes of lung nodules, and their frequent proximity to lung tissues, which complicates clear delineation. We aim to develop an accurate and reliable lung nodule segmentation method to assist radiologists in improving diagnostic accuracy. METHODS: We introduce a novel model for segmenting lung nodules in computed tomography (CT) images, leveraging a deep learning framework that integrates U-Net based segmentation and ResNet based classification processes. Feature combination blocks are applied to facilitate the sharing of information between the segmentation and classification components. Additionally, we employ the classification outcomes as priors to refine the size estimation of the segmentation outputs, and integrate the classification outcomes with a spatial regularization technique to enhance precision. Furthermore, recognizing the challenges posed by limited training datasets, we have developed an optimal transfer learning (TL) strategy that freezes certain layers to further improve performance. RESULTS: The results show that our proposed model can capture the target nodules more accurately compared to other commonly used models. The ablation studies prove the positive effect of feature combination and spatial regularization. By applying TL, the performance can be further improved, achieving a sensitivity of 0.885, a Dice score of 0.814, a Hausdorff distance (HD) of 3.188 mm and an average symmetric surface distance (ASSD) of 0.280 mm. CONCLUSIONS: The proposed multitask model performs lung nodule segmentation while facilitating classification outputs with feature combination and through regularization. By utilizing TL, the model achieves strong performance even with limited training data. Its simplicity makes it adaptable and provides a foundation for further enhancements to suit other specific datasets.