Synthetic aperture radar (SAR) is a technique widely used in the field of ship detection. However, due to the high ship density, fore-ground-background imbalance, and varying target sizes, achieving lightweight and high-precision multiscale ship object detection remains a significant challenge. In response to these challenges, this research presents YOLO-MSD, a multiscale SAR ship detection method. Firstly, we propose a Deep Poly Kernel Backbone Network (DPK-Net) that utilizes the Optimized Convolution (OC) Module to reduce data redundancy and the Poly Kernel (PK) Module to improve the feature extraction capability and scale adaptability. Secondly, we design a BiLevel Spatial Attention Module (BSAM), which consists of the BiLevel Routing Attention (BRA) and the Spatial Attention Module. The BRA is first utilized to capture global information. Then, the Spatial Attention Module is used to improve the network’s ability to localize the target and capture high-quality detailed information. Finally, we adopt a Powerful-IoU (P-IoU) loss function, which can adjust to the ship size adaptively, effectively guiding the anchor box to achieve faster and more accurate detection. Using HRSID and SSDD as experimental datasets, mAP of 90.2% and 98.8% are achieved, respectively, outperforming the baseline by 5.9% and 6.2% with a model size of 12.3 M. Furthermore, the network exhibits excellent performance across various ship scales.