To improve the synthetic aperture radar (SAR) target discrimination performance under complex scenes, this letter presents a new SAR target discrimination method based on the bag-of-words model. The method contains three main stages. In the local feature extraction stage, the SAR-SIFT feature is extracted. In the feature coding stage, we improve the existing category-specific and shared dictionary learning (CSDL) and propose the sample-reweighted CSDL (SR-CSDL). The local features are sparsely coded using the codebook learned from SR-CSDL. In the feature pooling stage, spatial pyramid matching with max pooling is used to aggregate the local coding coefficients to generate the global feature for each chip image. Experimental results using the miniSAR data verify the effectiveness of the proposed method.