Grain weight and grain shape are important traits that determine rice grain yield and quality. Mining more quantitative trait loci (QTLs) that control grain weight and shape will help to further improve the molecular regulatory network of rice grain development and provide gene resources for high-yield and high-quality rice varieties. In the present study, a QTL for grain length (GL) and grain width (GW), qGL5.2, was firstly fine-mapped into a 21.4 kb region using two sets of near-isogenic lines (NILs) derived from the indica rice cross Teqing (TQ) and IRBB52. In the NIL populations, the GL and ratio of grain length to grain width (RLW) of the IRBB52 homozygous lines increased by 0.16-0.20% and 0.27-0.39% compared with the TQ homozygous lines, but GW decreased by 0.19-0.75%. Then, by analyzing the grain weight and grain shape of the knock-out mutant, it was determined that the annotation gene Os05g0551000 encoded a RING-type E3 ubiquitin ligase, which was the cause gene of qGL5.2. The results show that GL and RLW increased by 2.44-5.48% and 4.19-10.70%, but GW decreased by 1.69-4.70% compared with the recipient. Based on the parental sequence analysis and haplotype analysis, one InDel variation located at -1489 in the promoter region was likely to be the functional site of qGL5.2. In addition, we also found that the Hap 5 (IRBB52-type) increased significantly in grain length and grain weight compared with other haplotypes, indicating that the Hap 5 can potentially be used in rice breeding to improve grain yield and quality.